ASP .Net

 

Embed or link this publication

Description

ASP

Popular Pages


p. 1



[close]

p. 2

asp.net 2.0 for dummies by bill hatfield

[close]

p. 3



[close]

p. 4

asp.net 2.0 for dummies by bill hatfield

[close]

p. 5

asp.net 2.0 for dummies® published by wiley publishing inc 111 river street hoboken nj 07030-5774 www.wiley.com copyright © 2006 by wiley publishing inc indianapolis indiana published by wiley publishing inc indianapolis indiana published simultaneously in canada no part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording scanning or otherwise except as permitted under sections 107 or 108 of the 1976 united states copyright act without either the prior written permission of the publisher or authorization through payment of the appropriate per-copy fee to the copyright clearance center 222 rosewood drive danvers ma 01923 978 750-8400 fax 978 646-8600 requests to the publisher for permission should be addressed to the legal department wiley publishing inc 10475 crosspoint blvd indianapolis in 46256 317 572-3447 fax 317 572-4355 or online at http www.wiley.com/go/permissions trademarks wiley the wiley publishing logo for dummies the dummies man logo a reference for the rest of us the dummies way dummies daily the fun and easy way dummies.com and related trade dress are trademarks or registered trademarks of john wiley sons inc and/or its affiliates in the united states and other countries and may not be used without written permission all other trademarks are the property of their respective owners wiley publishing inc is not associated with any product or vendor mentioned in this book limit of liability/disclaimer of warranty the publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties including without limitation warranties of fitness for a particular purpose no warranty may be created or extended by sales or promotional materials the advice and strategies contained herein may not be suitable for every situation this work is sold with the understanding that the publisher is not engaged in rendering legal accounting or other professional services if professional assistance is required the services of a competent professional person should be sought neither the publisher nor the author shall be liable for damages arising herefrom the fact that an organization or website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or website may provide or recommendations it may make further readers should be aware that internet websites listed in this work may have changed or disappeared between when this work was written and when it is read for general information on our other products and services please contact our customer care department within the u.s at 800-762-2974 outside the u.s at 317-572-3993 or fax 317-572-4002 for technical support please visit www.wiley.com/techsupport wiley also publishes its books in a variety of electronic formats some content that appears in print may not be available in electronic books library of congress control number 2005927624 isbn-13 978-0-7645-7907-3 isbn-10 0-7645-7907-x manufactured in the united states of america 10 9 8 7 6 5 4 3 2 1 1o/sy/rr/qv/in

[close]

p. 6

about the author bill hatfield is the best-selling author of numerous computer books including active server pages for dummies creating cool vbscript web pages and windows xp in 10 easy steps or less all from wiley he is also the editor of visual studio .net developer a monthly technical journal from pinnacle publishing he s a microsoft certified trainer mct a microsoft certified solution developer mcsd and co-founder of the indianapolis .net developers association he works as a corporate instructor for new horizons in indianapolis indiana where he also loves to spend time with his family dedication this book is dedicated to the best kids in the world bryce and zoe you two have given me the greatest gift anyone can receive the ability to love someone else more than myself before you were in my life i couldn t imagine having kids now i can t imagine how impoverished my life would have been without the two of you in it thanks for making me a better person and for being so much fun to pal around with author s acknowledgments thanks to katie feltman acquisitions editor your kindness patience and dedication to the quality of this book are the best an author could ask for to ken cox my technical editor for great feedback and thoughtful suggestions to copy editor virginia sanders for helping me come across more clearly thanks also to all the rest of the wiley staff that helped make this book possible to my wife thank you so much for your support with this and my many other projects and activities it isn t easy dealing with a sometimes only sometimes moody daddy and thanks most of all for your endless love and care for the best kids in the whole world i think we make good babies thanks to mom and dad now more commonly known as mamaw and papaw now that i have a little bit better idea what you went through i think i have a lot to apologize for thanks to my good friends brad mike curtis and dee wayne and takiesha you guys are a lot of fun a welcome refreshment from a crazy world and to my buddy steve a sophisticated mind that never fails to appreciate the baser things in life!

[close]

p. 7

publisher s acknowledgments we re proud of this book please send us your comments through our online registration form located at www.dummies.com/register some of the people who helped bring this book to market include the following acquisitions editorial and media development project editor mark enochs acquisitions editor katie feltman copy editor virginia sanders technical editor ken cox editorial manager leah cameron media development specialist kit malone media development coordinator laura atkinson media project supervisor laura moss media development manager laura vanwinkle editorial assistant amanda foxworth cartoons rich tennant www.the5thwave.com composition services project coordinator kathryn shanks layout and graphics carl byers denny hager joyce haughey stephanie d jumper barbara moore barry offringa lynsey osborn heather ryan julie trippetti proofreaders leeann harney jessica kramer carl william pierce techbooks production services indexer techbooks production services special help kelly ewing laura miller blair pottenger heidi unger publishing and editorial for technology dummies richard swadley vice president and executive group publisher andy cummings vice president and publisher mary bednarek executive acquisitions director mary c corder editorial director publishing for consumer dummies diane graves steele vice president and publisher joyce pepple acquisitions director composition services gerry fahey vice president of production services debbie stailey director of composition services

[close]

p. 8

table of contents introduction 1 i know who you are 1 about this book 2 about asp.net 2.0 2 how this book is organized 2 part i getting started 3 part ii introducing asp.net 2.0 3 part iii speaking the language 3 part iv classy objects and methodical properties 3 part v creating interactive web applications 4 part vi casting a wider asp.net 2.0 4 part vii tapping the database 4 part viii exploring new asp.net 2.0 features 5 part ix the part of tens 5 appendix 5 napoleon bonus part get it on the cd 6 conventions used in this book 6 icons used in this book 7 where to go from here 8 asp me i might answer 9 help it doesn t work 10 part i getting started 11 chapter 1 asp.net 2.0 just do it .13 do i need a development environment 13 everything you need to get started 14 watch your language 16 understanding the development and testing process 16 choosing an asp.net web server 16 understanding where iis looks for your pages 17 saving your page with the .aspx extension 17 testing your pages 18 getting your asp in gear creating an asp.net page 18 understanding how this example works 20 modifying retesting and creating pages 22 modifying and retesting pages 22 creating new pages 23 converting html pages to asp.net pages 23

[close]

p. 9

vi asp.net 2.0 for dummies chapter 2 putting asp.net 2.0 in its place .25 understanding simple static html 25 exploring how javascript makes your pages more interactive 26 so how does asp.net work how is it different 27 the asp.net advantage faster simpler smaller 28 and now presenting asp.net 2.0 29 the bigger picture the .net framework 29 part ii introducing asp.net 2.0 31 chapter 3 exciting new asp.net 2.0 features .33 discovering the big new features 33 being the master of your domain with the master pages feature 34 using themes and skins 34 parts is web parts 35 exploring the faster better features 35 dancing with the database 36 new server controls make your user interface sing 36 increased security that doesn t require you to remove your shoes 37 asp.net 2.0 the configurator 37 navigating the choppy seas of your web site 38 chapter 4 introducing visual web developer 2005 express .39 visual web developer 2005 express what is it besides a mouthful 39 accessing resources from the start page 40 creating a new web site 41 choosing a template 42 selecting the location and language 43 getting to know your workspace 44 the toolbox window 44 the document window 45 the solution explorer window 46 the properties window 46 the task window 47 adding pages to your site 47 creating your user interface with server controls 48 adding server controls 48 setting control properties 49 writing code in response to events 51 debugging compiling and running your web application 52 using vwde to run the examples in this book 54 single-file versus code-behind pages 55

[close]

p. 10

table of contents vii part iii speaking the language 57 chapter 5 juggling information and firing off functions .59 getting started with programming 60 what is a programming language 60 compiling and running a program 60 looking at the asp.net process 61 understanding web applications 61 keeping your tags and code apart with delimiters 62 using the asp.net page directive 63 creating and using variables 63 creating variables 63 displaying variable values 65 can you use a variable you didn t declare 66 vee have vays of making you declare 67 she s not my data type 67 don t string me along 69 giving a variable a value when you create it 70 controlling cantankerous constants 70 keeping your comments to yourself 71 understanding how functions function 72 getting a date 72 let the arguments commence 73 chapter 6 asking questions and jumping through loops .75 decisions decisions decisions using if then 75 if you want cool web pages then use conditionals 76 using boolean variables with conditions 78 accepting inequalities as a fact of life 79 creating a compound if then 80 lies all lies or what to do if the condition isn t true 81 handling multiple conditions 82 developing your nesting instincts 84 get off my case 85 counselor present your case 86 cracking a tougher case 87 loop the loop 88 counting with for next 89 watching where you step 90 nesting loops 91 doobee-doobee-do loop 93 exit stage left 95 before you continue 96 juggling information with arrays 96 creating and using arrays 96 using for each next with arrays 98

[close]

p. 11

viii asp.net 2.0 for dummies chapter 7 divide and conquer structured programming .99 simplifying your life structured programming and functions 100 giving your functions a place to live the script tag 100 creating functions 101 calling functions 102 opening arguments 104 functions in all shapes and sizes 106 creating and using subroutines 107 making a quick exit 108 oh the places your variables will go 108 three kinds of variables 108 two places you can use variables 110 understanding how scope impacts your asp.net pages 110 part iv classy objects and methodical properties 113 chapter 8 oops no mistake here .115 looking at a real-world example my car 116 programming objects 117 creating a class 118 using the class to make an object 119 using the properties and methods in an object 120 creating multiple instances 120 get out this is private property 122 objects inside objects inside 124 why oop answer the .net framework class libraries 125 chapter 9 cool stuff you can do with asp.net 2.0 objects .127 arraylist the super handy-dandy array-type thingy 127 working over your friends 128 exploring additional arraylist features 129 using automatically created objects 131 the input and output objects request and response 131 scribbling with response.write 131 sending the user to another page with response.redirect 132 going long for the pass with request.querystring 132 the application and session objects more variable scope options 135 the application versus the session 135 it s a bird it s a plane no it s a super-global session variable 136 using even-more-super application variables 136 understanding the difference between session-level and application-level variables 138

[close]

p. 12

table of contents ix part v creating interactive web applications 139 chapter 10 interfacing with your users .141 examining web forms and server controls 141 creating a simple form 142 capturing events and changing properties 144 manipulating server control properties 147 changing properties in code and in the tag 147 using enumeration properties to assign values 148 using enumeration object methods 149 working with subobject properties 149 chapter 11 turning the page .151 page me 151 the problem initializing controls with a function 152 the solution using the page_load event 153 page_load is it triggered the first time or every time 154 making your head spin with server round-trips 157 a puzzling example the no-count counter 157 discovering the answer to the mystery 159 viewstate to the rescue 159 an easier way to store and retrieve page variables in viewstate 161 chapter 12 basic server controls labels text boxes and buttons .165 don t label me 165 adding a splash of color 165 settling a border dispute 167 finding the font of youth 168 sizing up your label with the height and width properties 170 tooltip don t run with scissors 170 the enabled and visible properties 171 shadowboxing no text boxing 171 he s only half illiterate he s readonly 171 put tabindex a in slotindex b 172 the many faces of the textmode property 172 the textbox s textchanged event and autopostback property 174 button button who s got the button 177

[close]

p. 13

x asp.net 2.0 for dummies chapter 13 making a list control and checking it twice .179 checking for check boxes 179 a checkboxlist example know your primes 180 responding to the user s answer 183 using common checkboxlist properties 184 the checkbox control 188 using common checkbox properties 189 radio for help on radio buttons 190 a radiobuttonlist example more gazillionaire trivia 191 a radiobutton example notification options 193 using common radiobuttonlist and radiobutton properties 194 your kiss is on my listbox 195 a listbox example the personalize your pc page 195 using common listbox properties 198 using common listbox.items methods 199 an add/remove/clear example the grocery list page 201 searching the grocery list with findbytext 203 dropping in on the dropdownlist 204 a dropdownlist example site navigation 204 using common dropdownlist properties and methods 206 chapter 14 more user interface goodies and how to make your own .207 a few image link and button controls 207 your image consultant 208 click me i m beautiful imagebutton 209 a button disguised as a link linkbutton 211 handling the hysterical hyperlink 213 marking time with the calendar control 215 a calendar example unborn baby age calculator 215 using common calendar members 217 doing it yourself user controls 220 creating a reusable page header 220 using the page header 222 rolling your own dice 223 yacht see 226 chapter 15 getting it right validating user input .229 putting requiredfieldvalidator to work 230 using requiredfieldvalidator with a text box 230 using requiredfieldvalidator with a drop-down list 231 using comparevalidator 232 comparing with a value 232 comparing with another control 234 keeping the user in range with rangevalidator 235 checking the range with two values 235 checking the range with other controls 236

[close]

p. 14

table of contents displaying the results with validationsummary 236 using page.isvalid to ensure that all is well 239 using the validationsummary to clean up the page 239 client versus server validation 240 i want more 240 xi part vi casting a wider asp.net 241 chapter 16 variable data types preaching to the converted .243 meeting the elementary data types 243 storing whole numbers 244 storing numbers with a decimal point 244 storing values other than numbers 245 using automatic and explicit type conversion 247 amassing your conversion function arsenal 249 standard conversion functions 249 the ctype conversion function 250 using the int val and str conversion functions 251 be strict spare the rod spoil the programmer 251 chapter 17 my what big namespaces you have mr framework .253 the great organizer namespaces 253 sending e-mail from your asp.net 2.0 page 254 finding your way through the forest of namespaces 255 asp.net 2.0 it s in there 257 my keyword you can t have any 257 creating and deleting files 258 copying and moving files 259 chapter 18 real-world web application issues .261 what s a web application 261 creating a virtual folder for your web application 262 the global.asax file 264 application and session object events 265 global directives import 267 the configuration file 267 the machine.config versus web.config 267 how does xml work 268 the web.config file 269 another way to change your configuration 273 storing your application settings in the web.config file 274

[close]

p. 15

xii asp.net 2.0 for dummies part vii tapping the database 277 chapter 19 accessing a database with simple queries .279 building classy classifieds 1.0 allads.aspx 279 the import of database access libraries 280 cool database-access server controls 281 getting ready to access the database 282 getting the database 282 creating a home for your application 283 web.config and the connectionstrings 283 retrieving and displaying data 284 the sqldatasource control and its properties 286 the gridview control and its properties 287 identifying the columns to display 287 using gridview beautification properties 289 sorting out the grid 290 paging dr gridview 292 chapter 20 using sophisticated queries and updating the database .295 using select parameters to narrow your query 296 there s no place like home 296 using the querystringparameter 297 using the controlparameter tag 301 using detailsview 305 binding in new ways alternatives to boundfield 308 retrieving and working with data from code 311 allowing the user to update the database 314 letting the user insert a new row 315 allowing the user to edit or delete a selected row 320 part viii exploring new asp.net 2.0 features 327 chapter 21 mastering master pages .329 getting to know master pages and content pages 329 making your master page 331 the content page jack of all trades master of none 332 running and testing your pages 333 no content page can serve two masters 334

[close]

Comments

no comments yet

YOUBLISHER
About
What Others Say
Sitemap
Impressum

PUBLISHERS
Login
Signup
Tutorials
FAQ
Support

BUSINESS
Overview
Advertising
Support

DEVELOPERS
API

LEGAL
Report a Copyright Violation
Copyright FAQ
Terms of Use
Privacy Policy