Tải bản đầy đủ (.pdf) (802 trang)

2003 ms asp net programming with visual c sharp net 2003

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (11.2 MB, 802 trang )

MicrosoftASP.NET
Programmingwith
MicrosoftVisualC#.NET
Version2003StepbyStep
byG.Andrew ISBN:0735619352
Duthie
MicrosoftPress©2003(601
pages)

Appropriatefornovice
developerswithsome
programmingexperience,
thisbookprovides
instructionsforconfiguring
ASP.NETapplications,
creatingwebforms,using
servercontrols,accessing
datawithADO.NET,and
understandingXML-based
webservices.
CompanionWebSite
TableofContents
MicrosoftASP.NETProgrammingwith
VisualC#.NETVersion2003Stepby
Step
Introduction
Part1-GettingStartedwithASP.NET

Chapter1 Chapter2 -

OpeningandRunningan


ASP.NETWebApplication
Creating:anASP.NETWeb


Application
Understanding
Chapter3 ProgrammingBasics
Part2-ASP.NETInfrastructure

Chapter4 - ManagingState
ConfiguringanASP.NET
Chapter5 Application
Chapter6 - SecurityinASP.NET
Part3-ASP.NETWebForms

Chapter7 - CreatingWebForms
Chapter8 - UsingServerControls
AccessingandBinding
Chapter9 Data
Part4-BeyondtheBasics

CreatingCustomServer
Controls
CreatingandUsingWeb
Chapter11 Services
UsingCachingtoImprove
Chapter12 Performance
DeployinganASP.NET
Chapter13 Application
TracingandDebugging

Chapter14 ASP.NETApplications
Chapter10 -

Part5-Appendixes

MigratingfromASPto
ASP.NET
ASP.NETConfiguration
AppendixB Elements
InstallingVisualStudio
AppendixC AppendixA -


.NET2003
Index
ListofTables
ListofCodeExamples
ListofSidebars


BackCover
Teachyourselfhowtowritehigh-performanceWeb
applicationswithASP.NETandVisualC#.NET2003one
stepatatime.Thispractical,hands-ontutorial
expertlyguidesyouthroughthefundamentaltoolsand
technologies,includingthecommonlanguageruntime,
WebForms,XMLWebservices,andtheMicrosoft.NET
Framework1.1includingnewASP.NETmobilecontrols.
Workatyourownpacethroughtheeasy-to-follow
lessonsandhands-onexercisestolearnessential

techniques.Andaccelerateyourproductivityby
workingwithinstructivecodeexamplesandbest
practicesforASP.NETWebdevelopmentwithVisual
C#.
Discoverhowto:
CreateaWebapplication,addanewWebForms
page,andaddcontrols
Manageapplicationstateandenablesessionstate
Configureapplicationsanduseside-by-side
versioning
ImplementsecurityfeaturesinASP.NET,including
newRequestValidation
CreateWebFormspages
Delvedeeperintoservercontrolsandbuildyour
own
Accessandbinddata


CreateanduseWebservices
Usechachingtoimproveperformance
TraceanddebugASP.NETapplications
DeployapplicationsmanuallyorthroughVisual
Studio.NET
AbouttheAuthor
G.AndrewDuthieisthefounderandprincipalof
GraymadEnterprises,Inc.,providingtrainingand
consultinginMicrosoftWebdevelopmenttechnologies.
AndrewhasbeendevelopingmultitierWebapplications
sincetheintroductionofActiveServerPages.Heisa
frequentspeakeratindustryeventsandtheauthorof

MicrosoftVisualInterDev6.0EnterpriseDevelopers
Workshop,alsofromMicrosoftPress.


MicrosoftASP.NETProgrammingwithVisualC#
.NETVersion2003StepbyStep
G.AndrewDuthie
PUBLISHEDBY
MicrosoftPress
ADivisionofMicrosoftCorporation
OneMicrosoftWay
Redmond,Washington98052-6399
Copyright©2003byMicrosoftCorporation
Allrightsreserved.Nopartofthecontentsofthisbookmaybe
reproducedortransmittedinanyformorbyanymeanswithoutthe
writtenpermissionofthepublisher.
LibraryofCongressCataloging-in-PublicationData
Duthie,G.Andrew,1967MicrosoftASP.NETProgrammingwithVisualC#.NETVersion2003
Stepby
Step/G.AndrewDuthie.
p.cm.
Includesindex.
ISBN0-7356-1935-2
1.Activeserverpages.2.WebsitesDesign.3.Web
serversComputerprograms.I.
Title.
TK5105.8885.A26D892003
005.276dc212003042215
PrintedandboundintheUnitedStatesofAmerica.
123456789QWE876543

DistributedinCanadabyH.B.FennandCompanyLtd.
ACIPcataloguerecordforthisbookisavailablefromtheBritishLibrary.


MicrosoftPressbooksareavailablethroughbooksellersanddistributors
worldwide.Forfurtherinformationaboutinternationaleditions,contact
yourlocalMicrosoftCorporationofficeorcontactMicrosoftPress
Internationaldirectlyatfax(425)936-7329.VisitourWebsiteat
www.microsoft.com/mspress.Sendcommentsto

ActiveDirectory,ActiveX,FrontPage,JScript,Microsoft,MicrosoftPress,
Outlook,VisualBasic,VisualC++,VisualC#,VisualFoxPro,Visual
InterDev,VisualJ++,VisualSourceSafe,VisualStudio,Windows,and
WindowsNTareeitherregisteredtrademarksortrademarksofMicrosoft
CorporationintheUnitedStatesand/orothercountries.Openwaveand
theOpenwavelogoaretrademarksofOpenwaveSystemsInc.Allrights
reserved.Otherproductandcompanynamesmentionedhereinmaybe
thetrademarksoftheirrespectiveowners.
Theexamplecompanies,organizations,products,domainnames,e-mail
addresses,logos,people,places,andeventsdepictedhereinare
fictitious.Noassociationwithanyrealcompany,organization,product,
domainname,e-mailaddress,logo,person,place,oreventisintended
orshouldbeinferred.
AcquisitionsEditor:AnneHamilton
ProjectEditor:LynnFinnel
BodyPartNo.X09-45931
Acknowledgments
Iwanttoexpressmythanksforthesupportandassistanceprovidedby
myprojecteditoratMicrosoftPress,LynnFinnel,aswellasforher
persistenceandperseveranceontheproject.Thanksalsototheediting

teamforcatchingmygoofsandhelpingmakemyworkthebestitcanbe.
MythanksespeciallytoAnneHamiltonforherongoingsupportformy
work.
Lastbutnotleast,Ithankmywife,Jennifer.Herlove,patience,and
supportmakemyworkpossibleandworthwhile.


G.AndrewDuthie
March,2003
G.AndrewDuthie
G.AndrewDuthieisthefounderandprincipalofGraymadEnterprises,
Inc.(providingtrainingandconsultingin
MicrosoftWebdevelopmenttechnologies.Andrewhasbeendeveloping
multi-tierWebapplicationssincetheintroductionofActiveServerPages.
Hewroteaboutdevelopingscalablen-tierapplicationsinMicrosoftVisual
InterDev6.0EnterpriseDevelopersWorkshop,alsofromMicrosoftPress.
Andrewisafrequentspeakeratevents,includingSoftwareDevelopment,
theDev-Connectionsfamilyofconferences,MicrosoftDeveloperDays,
andVSLive!Healsospeaksat.NETusergroupsasamemberofthe
International.NETAssociation(INETA)SpeakersBureau
( />InadditiontohisworkforGraymadEnterprises,Andrewenjoysspending
timewithhiswife,Jennifer,playingmusic,andsmokinghismeerschaum
pipe.YoucanreachAndrewbyemailat
ThemanuscriptforthisbookwaspreparedandsubmittedtoMicrosoft
Pressinelectronicform.PageswerecomposedbynSight,Inc.using
AdobeFrameMaker+SGMLforWindows,withtextinSabonanddisplay
typeinITCFranklinGothic.Composedpagesweredeliveredtothe
printeraselectronicpre-pressfiles.
Coverdesigner:GregHickman
InteriorGraphicDesigner:JamesD.Kramer

PrincipalCompositor:DonaldCowan
CopyEditor:LisaWehrle
TechnicalEditor:ChrisRusso
PrincipalProofreader:JenniferCarr


Indexer:JackLewis,J&JIndexing


Introduction


FindingYourBestStartingPoint
MicrosoftASP.NETProgrammingwithMicrosoftVisualC#.NET2003
StepbyStepisdesignedtoprovideacomprehensiveintroductionand
overviewofdevelopingWebapplicationswithASP.NET.Thegoalofthis
bookistohelpyoubecomecompetentatthebasicskillsnecessaryfor
creatingandusingASP.NETapplications.Tohelpyougetthereas
quicklyandeasilyaspossible,thisbookhasbeendividedintofourparts,
eachcomposedofoneormorechaptersrelatedtoaspecifictopic.Over
thecourseofthesepartsandchapters,youlllearnaboutthenew
Microsoft.NETdevelopmentplatformandthepartthatASP.NETplaysin
it.YoullalsolearntheskillsnecessarytotakeadvantageofASP.NET
WebForms,ServerControls,andXML-basedWebservices.
Dependingontheskillsandexperienceyoubringtothisbook,youmight
wanttostartwithaparticularpartofinteresttoyouorskipovercertain
partsentirely.Thefollowingtablecanhelpyoudecidewheretostart.
Ifyouare

Followthesesteps


New


1. Installthesamplefilesasdescribed
inInstallingtheSampleFilesonpage
xvii.

Toprogramming

2. Learnaboutthebackgroundofthe
Microsoft.NETFrameworkand
ASP.NETbyreadingChapters16.
TheneitherworkthroughPart3ifyou
wanttoknowmoreaboutthe
technologiesunderlyingASP.NETor
workthroughPart4ifyouwanttoget
straightintothecoding.
3. Workthroughtherestoftheparts
andchaptersbasedonyourinterest


inthevarioustopics.
Switching


1. Installthesamplefilesasdescribed
inInstallingtheSampleFilesonpage
xvii.
2. ReadorscanParts1and2ifyoure

interestedinthebackgroundof.NET
andASP.NET.

FromclassicASPor
similartechnologies

3. WorkthroughPart3forbasicWeb
Formsskillsaswellasanintroduction
tousingASP.NETServerControls
andaccessingdatawithADO.NET.
4. WorkthroughPart4foradditional
ASP.NETapplicationskills.

Referencing

Thisbookafter
workingthroughthe
chapters


1. Usetheindextolocateinformation
aboutspecifictopics,andusethe
tableofcontentstolocateinformation
aboutgeneraltopics.
2. ReadtheQuickReferenceattheend
ofeachchapterforabriefreviewof
themajortasksineachchapter.

Corrections,Comments,andHelp
Everyefforthasbeenmadetoensuretheaccuracyofthisbookandthe

contentsofthesamplefiles.MicrosoftPressprovidescorrectionsand
additionalcontentforitsbooksthroughtheWorldWideWebatthe
followingaddress:
/>

ToconnectdirectlytotheMicrosoftPressKnowledgeBaseandentera
queryaboutaquestionyoumayhave,visit:
/>Ifyouhaveproblems,comments,orideasregardingthisbookorthe
samplefiles,pleasesendthemtoMicrosoftPress.
Sende-mailto:

Orsendpostalmailto:
MicrosoftPress
Attn:DeveloperStepbyStepSeriesEditor
OneMicrosoftWay
Redmond,WA98052-6399
Pleasenotethatproductsupportisnotofferedthroughtheabove
addresses.ForhelpwithASP.NET,youcanconnecttoMicrosoft
TechnicalSupportontheWebatsupport.microsoft.com/directory,orfor
additionaldeveloperinformationaboutASP.NET,goto
www.microsoft.com/netandsearchonASPNET.

VisittheMicrosoftPressWorldWideWebSite
YouarealsoinvitedtovisittheMicrosoftPressWorldWideWebsiteat
thefollowinglocation:
/>YoullfinddescriptionsforthecompletelineofMicrosoftPressbooks
(includingothersbyG.AndrewDuthie),informationaboutorderingtitles,
noticeofspecialfeaturesandevents,additionalcontentforMicrosoft
Pressbooks,andmuchmore.



InstallingtheSampleFiles
ThesamplecodeusedinthisbookisavailableonthebooksWebsiteat
Todownloadthe
samplefiles,clicktheCompanionContentlinkintheMoreInformation
menuontherightsideoftheWebpage.ThiswillloadtheCompanion
Contentpage,whichincludesthelinkfordownloadingthesamplefiles.
Toinstallthesamplefiles,runtheexecutablefiledownloadedfromthe
linkandacceptthelicenseagreementthatispresented.
Bydefault,thefileswillbecopiedtothefolder
C:\MicrosoftPress\ASPNETSBS_CS.Thedestinationfolderwillalso
containareadme.htmfilethatyoullneedtorefertoforinstructionsin
settingupandusingthesamplefiles.

SystemRequirements
TousethesamplecodeprovidedattheWebsite,youllneedacomputer
withthefollowingconfiguration:
MicrosoftWindows2000(SP3orlaterrecommended),XP
Professional,orWindowsServer2003,Webedition.
MicrosoftSQLServer2000(Personal,Standard,orEnterprise
Edition,SP3recommended)ortheMicrosoftSQLServer
DesktopEngine(MSDE),whichisincludedwithVisualStudio
.NET2003.
MicrosoftInternetExplorer5.5orlater.
InternetInformationServices(IIS).(ToaccesstheASP.NET
features,youmustinstallIISpriortoinstallingtheMicrosoft.NET
Framework.)
The.NETFrameworkSDK,whichyoucandownloadfromthe
MSDNWebsiteat
default.asp.

(BecauseMicrosoftVisualStudio.NETincludestheSDK,you


dontneedtoinstallthe.NETFrameworkSDKseparatelyifyou
installVisualStudio.NET.)NotethatWindowsServer2003
comeswiththe.NETFrameworkversion1.1preinstalled,soyou
donotneedtoinstallthisseparately.
VisualStudio.NET2003orVisualC#.NET2003,Professional
Editionorhigher.YoucanusetheStandardedition,butsome
chapters(includingChapter10)useprojecttypesonlyavailable
intheProfessionalandhighereditions.
Note Tomoreeasilyrunsomeofthecommand-linetoolsin
the.NETFramework(suchaswsdl.exeandthe
command-linecompilers),youmightalsoneedtoadd
thepathstotheseutilitiestothePATHenvironment
variable,asdescribedinAppendixC.Ifyouhave
problemsrunninganyofthecommand-linetools,you
canusetheWindowsSearchfacility(locatedonthe
Startmenu)tosearchforthelocationofthesetools.
ThenaddthepathtotheirlocationtothePATH
environmentvariable.


ConventionsUsedinThisBook
Youcansavetimewhenusingthisbookifyoutakethetimeto
understandhowinstructions,keys,notes,andsoonareusedbeforeyou
startthefirstchapter.Pleasetakeamomenttoreadthefollowinglist,
whichexplainstheconventionsfortheseandotherelements.
Hands-onexercisesforyoutofollowaregiveninnumberedlists
ofsteps(1,2,andsoon).

Textthatyouaretotypeappearsinboldfacetype.
Asyouworkthroughsteps,youwilloccasionallyseetableswith
listsofpropertiesthatyouwilltypeintoVisualC#.NET.
Aplussignbetweentwokeynamesmeansthatyoumustpress
thosekeysatthesametime.Forexample,PressAlt+Tabmeans
thatyouholddowntheAltkeywhilepressingtheTabkey.
NoteslabeledNOTEprovideadditionalinformationortipsabout
atopic.
NoteslabeledIMPORTANTalertyoutoessentialinformationthat
youshouldcheckbeforecontinuingthechapter.Thiscaninclude
informationtohelpyouavoidproblemssuchasapplication
crashesorsecurityissues.
NoteslabeledTIPcanhelpsaveyoutimeandtroubleasyouuse
thetechnologiesbeingdescribed.


Part1:GettingStartedwithASP.NET


ChapterList
Chapter1:OpeningandRunninganASP.NETWebApplication
Chapter2:CreatinganASP.NETWebApplication
Chapter3:UnderstandingProgrammingBasics


Chapter1:OpeningandRunninganASP.NET
WebApplication


Overview

Inthischapter,youwilllearnhowto:
StartMicrosoftVisualStudio.NET.
OpenandrunanASP.NETapplication.
Workwithtoolwindows.
ExitVisualStudio.NET.
MicrosoftASP.NETisnotjustanupgradenotbyalongshot.ASP.NET
providesthemostadvancedWebdevelopmentplatformcreatedtodate.
Whatsmore,ASP.NEThasbeenrebuiltfromthegrounduptocreatean
entirelynewandmoreflexibleinfrastructureforWebdevelopment.
WhatmakesASP.NETsorevolutionaryisthatitsbasedonMicrosofts
new.NETplatform,ormoreaccuratelytheMicrosoft.NETFramework.To
understandclearlywhereandwhentouseASP.NET,letstakesometime
togoovertheMicrosoft.NETplatform,theproductsthatitcomprises,
andwhereASP.NETfitswithinMicrosoft.NET.


UnderstandingMicrosoft.NET
Microsoft.NETisanumbrellatermthatdescribesanumberofrecently
releasedtechnologiesfromMicrosoft.Takentogether,thesetechnologies
arethemostsubstantialchangestotheMicrosoftdevelopmentplatform
sincethetransitionfrom16-bitto32-bitdevelopment.
Microsoft.NETincludesthefollowingtechnologyareas:
The.NETFramework
.NETlanguagesandlanguagetools
Inthenextsection,youlllearnaboutthesetechnologiesandhowyoucan
usethemtospeedupyourdevelopmentofrobust,high-performance
Web-orForms-basedapplicationsontheMicrosoftWindowsplatform.

The.NETFramework
The.NETFrameworkisanessentialtechnologyforASP.NET

development.Itprovidesthebasicsystemservicesthatsupport
ASP.NET,aswellasWindowsFormsdevelopment,thenewrichclient
developmenttechnologyprovidedby.NET.MuchliketheMicrosoft
WindowsNT4.0OptionPack,whichwasanadd-ontoWindowsNT4.0
thataddedInternetInformationServer4.0andActiveServerPages
technologiestoNT4.0,the.NETFrameworkisanadd-ontoMicrosoft
WindowsXP,Windows2000,WindowsNT4.0,andWindows98/MEthat
addsthebasicsupportingsystemservicesfor.NETtechnologies.The
frameworkwillalsobebuiltintonewerreleasesoftheWindowsserver
operatingsystemline,includingtheWindowsServer2003line.
Important WhileVisualStudio.NETissupportedontheWindows
98,WindowsNT,Windows2000,andWindowsXP
platforms,thefull.NETframeworkisnotavailableonall
platforms.Mostimportant,whileotherplatformscanbe
usedasASP.NETclients,ASP.NETapplicationswillrun
onlyonWindows2000andlater.


The.NETFrameworkconsistsoftwomainparts:
Thecommonlanguageruntime
The.NETFrameworkclasslibrary

TheCommonLanguageRuntime
Thecommonlanguageruntime(CLR)providesarun-timeenvironment
fortheexecutionofcodewritteninany.NETlanguage.TheCLR
managestheexecutionof.NETcode,includingmemoryandobject
lifetimemanagement.Inadditiontothesemanagementservices,the
CLRallowsdeveloperstoperformdebugging,exceptionhandling,and
inheritanceacrossmultiplelanguages.Performingthesetasksrequires
thatthelanguagecompilersfollowtheCommonLanguageSpecification

(CLS),whichdescribesasubsetofthedatatypessupportedbytheCLR
thatarecommontoallofthelanguagesusedin.NET.
Theindividuallanguagecompilerscompilethecodewrittenby
developersintoanintermediatelanguagecalledMicrosoftIntermediate
Language(ILorMSIL).TheIListhenJust-In-Time(JIT)compiledatfirst
execution.Optionally,ILassembliesmaybecompiledtonativecodeby
theCLRatinstalltimeusingautilitycalledngen.exe.Thiscanimprove
startuptime,althoughatsomecosttoperformance,duetooptimizations
availableduringJITcompilation.Notethatngen.execannotbeusedfor
assembliesgeneratedfromASP.NETpagesandcode-behindclasses.
CodethatiscompiledtoILandmanagedbytheCLRisreferredtoas
managedcode.ItscalledthisbecausetheCLRtakesresponsibilityfor
managingtheexecutionofthecode,includingtheinstantiationofobjects,
allocationofmemory,andgarbagecollectionofobjectsandmemory.
ComponentswritteninmanagedcodeandexecutedbytheCLRare
referredtoas.NETmanagedassemblies,orassembliesforshort.
Assembliesarethebasicunitofdeploymentinthe.NETworldandare
quitesimilartoCOMcomponents.ThedifferenceisthatwhereasaCOM
componenthasatypelibrarytodescribehowclientsshouldinteractwith
it,anassemblycontainsamanifest,whichisthesetofmetadatathat


describesthecontentsoftheassembly.Amongotheradvantages,the
self-describingnatureof.NETcomponentsmeansthattheydontneedto
beregisteredonacomputerinordertowork!
Thismetadataalsodescribesthedependenciesandversioninformation
associatedwithanassembly.Notonlydoesthismakeitmucheasierto
ensurethatallnecessarydependenciesofanassemblyarefulfilled,butit
alsomeansthatmultipleversionsofthesameassemblycanberunside
bysideonthesamecomputerwithoutconflict.Thisisamajorstepin

resolvingDLLHell,thebaneofmanydevelopersexistence.Justaskany
WebdeveloperwhosworkedwithmorethanoneversionofMicrosoft
ActiveXDataObjects(ADO),andyouresuretogetanearfulabout
applicationsbeingbrokenbyanewversionofADO.With.NET,thisissue
shouldbeathingofthepast.Aslongastheconsumingapplication
knowswhichversionofanassemblyitsdesignedtouse,itcanlocatethe
correctversionamongmultipleversionsofthesameassemblyby
queryingtheassemblysmetadata.
TheresagreatdealmoretotheCLR,whichyoulllearninfuturechapters.
IfyouneedfurtherinformationontheCLR,doasearchoncommon
languageruntimeineitherthe.NETFrameworkSDKdocumentationor
theMSDNLibrarydocumentationforVisualStudio.NET.

The.NETFrameworkClassLibrary
The.NETFrameworkclasslibraryisdesignedtosupporttheeffortsof
developersbyprovidingbaseclassesfromwhichdeveloperscaninherit.
Thisclasslibraryisahierarchicalsetof.NETclassesthatdevelopers
canuseintheirownapplications.Theseclasses,whichareorganizedby
containersreferredtoasnamespaces,providebothbasicandadvanced
functionalitythatdeveloperscaneasilyreuse.Theyincludeclassesthat
supportbasiccommondatatypes;classesthatprovideaccesstodata;
andclassesthatsupportsuchsystemservicesasdrawing(goodnews
foranyonewhoshadtouseathird-partycomponentfordynamically
creatinggraphicsinanASPapplication),networkfunctionality(including
DNSandreverseDNSlookups),andmanyothers.
ThelibraryalsocontainstheclassesthatformthebasisofASP.NET,


includingthePageclass(apartoftheSystem.Web.UInamespace)from
whichallASP.NETpagesarederived,aswellasmanyotherclassesin

theSystem.Webnamespaceandtheothernamespacesnestedunder
System.Web.Laterchapterswilldiscussseveraloftheseclasses.
Note TheASP.NETQuickStartTutorial(installedwiththe.NET
FrameworkSDKsamples)containsausefulClassBrowser
sampleapplication(whichcanbefoundat
http://localhost/QuickStart/aspplus/doc/classbrowser.aspxonce
youhaveinstalledthe.NETFrameworkSDKsamples)thatyou
canusetoviewthevariousclassesofthe.NETFramework
classlibrary.
Inheritance
Inheritanceisacentralconceptinthe.NETFramework.Itprovidesa
wayfordeveloperstouseexistingcodeinclasses.Aclasscanexpose
bothpropertiesandmethodsthatclientscanuse.Classesthatare
inheritedfromaparticularbaseclassaresaidtobederivedfromthat
class.Byinheritingfromaclass,adevelopercanreusethe
functionalitythatitexposeswithouthavingtorewritethecode.
Inaddition(andmoreimportant),adevelopercreatingaderivedclass
canoverrideoneormoreofthemethodsexposedbytheparentclass
inordertoprovideaspecializedimplementationofthatfunctionality.
Thiscapabilitywillcomeinhandywhenyoulearnaboutcustomserver
controlsinChapter10.

.NETLanguagesandLanguageTools
Oneofthebestthingsaboutthe.NETplatformisthatwhereasclassic
ASPrestricteddeveloperstousingscriptinglanguages(withtheir
inherentlimitations),ASP.NETletsyouworkwithany.NET-compliant
language.ThismeansthatthecodeyouwriteinASP.NETiscompiledfor
betterperformance,andyoucantakefulladvantageofadvanced
languagefeatures.



Forthe.NETplatform,languages(andthedevelopmenttoolswithwhich
youllusethem)areprobablyoneofthemostimportanttopicstodiscuss.
Letstakeahigh-levellookatsomeofthelanguagesandtoolsthatwillbe
availablefordeveloping.NETapplications.

NotepadandOtherTextEditors
Believeitornot,manydevelopers,particularlyASPdevelopers,stilldo
muchoftheirdevelopmentinMicrosoftNotepad(whichIusedtolovingly
refertoasVisualNotepad)orotherfreeorinexpensivetexteditors.
WhileNotepadhasthesubstantialadvantageofbeingubiquitous,itsnot
exactlywhatyoudcallarobustdevelopmentenvironment.Thatsaid,if
youreworkingwiththe.NETFrameworkSDK(ratherthanVisualStudio
.NET),theresnoreasonyoucantuseNotepad(oranotherfavoritetext
editor)todoallofyour.NETdevelopment.The.NETFrameworkSDK
includescommand-linecompilersforMicrosoftVisualBasic.NET,
MicrosoftVisualC#(pronouncedCsharp),andMicrosoftJScript.NET.
So,youcancreateyourclasses,ASP.NETpages,andsooninNotepad,
andthenyoucaneithercompilethemexplicitlyusingthecommand-line
compilersor,inthecaseofASP.NET,allowtheASP.NETruntimeto
dynamicallycompilethepagewhenitsrequestedforthefirsttime.

VisualStudio.NET
Forsimplerandfasterdevelopment,mostdeveloperswillprobablywant
toworkinVisualStudio.NET,whichprovidesasingleintegrated
developmentenvironment(IDE)forallofMicrosofts.NETlanguages
(withtheexceptionofMicrosoftVisualFoxPro7.0,whichdoesnotuse
theCLRorthe.NETFramework).ThismeansthatdevelopersofVisual
Basic,MicrosoftVisualC++,andC#allsharethesameIDE,including
thecapabilitytoperformdebuggingandexceptionhandlingacross

languages,inthesameenvironment.
VisualStudio.NETprovidesasubstantialnumberofnewfeatures,
including
Asingle,unifiedprogrammingmodelforall.NETlanguagesand
forbothWindowsandWebapplications


×