CS00

download CS00

of 36

Transcript of CS00

  • 7/25/2019 CS00

    1/36

    Introduction to .NETIntroduction to .NET

    Content : Introduction to .NET Technology

    Introduction to Web Based

    Applications Introduction to ASP.NET

    1

    By : Amrendra SharanBy : Amrendra Sharan

  • 7/25/2019 CS00

    2/36

    Introduction to .NETTechnology

  • 7/25/2019 CS00

    3/36

    3

    What is .NET ?

    Microsoft.NET is a Framework Microsoft .NET is a Framework which provides a

    common platform to Execute or, Run theapplications developed in various prorammin

    lanuaes.

    Microsoft announced the .NET initiative in !ul"#$$$.

    The main intention was to %ride the ap ininteroperability%etween services of variousprorammin lanuaes.

  • 7/25/2019 CS00

    4/36

    .NET Framework &%'ectives

    The .NET rame!or" is designed to #ul$ll the#ollo!ing ob%ecti&es:

    (rovide o%'ect)oriented prorammin

    environment

    (rovide environment for developin various t"pesof applications, such as Windows)%ased

    applications and We%)%ased applications

    To ensure that code %ased on the .NET Frameworkcan interate with an" other code

    4

  • 7/25/2019 CS00

    5/36

    .NET Framework

    CommonCommonLanguageLanguageSpecificationSpecification

    (CLR) Common(CLR) CommonLanguageLanguageRuntimeRuntime

    ADO.NETADO.NET

    C#C#

    Vi

    ua!

    Vi

    ua!Stu"io

    #$$%

    Stu"io

    #$$%

    AS&.NETAS&.NET

    'Scipt'Scipt

    *in"o+*in"o+

    ,om,om

    V-V- CC

    Opeating S/temOpeating S/tem

    -ae-aeC!aC!aLi0a/Li0a/

  • 7/25/2019 CS00

    6/36

    The .NET Framework consists of*

    The Common 'anguage Speci$cation (C'S)

    +t contains uidelines, that lanuae should followso that the" can communicate with other .NETlanuaes. +t is also responsi%le for T"pe matchin.

    The rame!or" Base Class 'ibraries (BC') consistent, o%'ect)oriented li%rar" of prepackaedfunctionalit" and pplications.

    The Common 'anguage *untime (C'*)

    lanuae)neutral development - executionenvironment that provides common runtime forapplication execution .

  • 7/25/2019 CS00

    7/36

    ommon /anuae0peci1cation

    C'S per#orms the #ollo!ing #unctions:

    Esta%lishes a framework that helps ena%lecross)lanuae interation, t"pe safet", and

    hih performance code execution (rovides an o%'ect)oriented model that

    supports the complete implementation of man"prorammin lanuaes

    2e1nes rules that lanuaes must follow, whichhelps ensure that o%'ects written in di3erentlanuaes can interact with each other

    2

  • 7/25/2019 CS00

    8/36

    .NET Framework 4ase lass/i%rar"

    The lass /i%rar" is a comprehensive, o%'ect)oriented collection of reusa%le t"pes

    These class li%rar" can %e used to develop

    applications that include*Traditional command)line applications

    5raphical user interface 657+8 applications

    pplications %ased on the latest innovations provided %"0(.NET

    We% Forms

    9M/ We% services

    %

  • 7/25/2019 CS00

    9/36

  • 7/25/2019 CS00

    10/36

    Execution in /R

    1$

    Common Language RuntimeCommon Language Runtime

    V-V-

    SouceSouce

    co"eco"e

    Compi!eCompi!e

    CCC#C#

    Aem0!/Aem0!/

    L Co"eL Co"e

    'T Compi!e'T Compi!e

    5anage"5anage"

    co"eco"e

    Nati6e Co"eNati6e Co"e

    Compi!eCompi!e Compi!eCompi!e

    Aem0!/Aem0!/

    L Co"eL Co"eAem0!/Aem0!/

    L Co"eL Co"e

    Opeating S/tem Se6iceOpeating S/tem Se6ice

  • 7/25/2019 CS00

    11/36

    =isual 0tudio #$$A +2E

    Microsoft has introduced VisualStudio.NET, which is a tool 6also called

    +nterated 2evelopment Environment8 fordevelopin .NET applications %" usinprorammin lanuaes such asVB, C,

    VC!! and V". etc.

    11

  • 7/25/2019 CS00

    12/36

    < 6 0harp8

    Microsoft < 6pronounced 0harp8 developed %"Microsoft orporation, 70

    New prorammin lanuae that runs on the .NET

    Framework

    < is simple, modern, t"pe safe, and o%'ect oriented

    < code is compiled as manaed code

    om%ines the %est features of =isual 4asic, >> and !ava

    1

  • 7/25/2019 CS00

    13/36

    < Features

    0imple Modern

    &%'ect)&riented

    T"pe)safe

    =ersiona%le

    ompati%le

    0ecure

    13

  • 7/25/2019 CS00

    14/36

    Introduction to Web BasedApplications

  • 7/25/2019 CS00

    15/36

    +ntroducin We% pplications

    17

    Static #ynamic

    Static web pa$e This type of web page consists of

    HTML code typed directly into text

    or a web page editor

    It is saved as an .%tmor .%tmlfile

    The content (text, iages, hyperlin!s, and so on" and

    appearance of a static web page is always the sae.

    These web pages do not #tili$e any database or any

    other technology that dynaically b#ilds #p pages or

    content at r#ntie based on their visitors inp#t.

    &eb 'a$e

  • 7/25/2019 CS00

    16/36

    ow re 0tatic We% (aes0erved ?

    1

    CLENT

    *E- SERVER

    1. Author

    writes

    HTML

    2. Client requests

    the web page

    3. Web Server locates

    .htl !ile

    ". HTML strea# !ro the

    .htl page$ returne% to

    the browser

    &. 'rowser processes

    HTML an% %ispla(s

    page

  • 7/25/2019 CS00

    17/36

    2"namic we% pae

    12

    2"namic We% sites provide its visitors to modif" thecontent of the we% pae %ased on their input.

    The" utili@e data%ases and other mechanisms thatena%le to

    identif" their visitors present them with customi@ed reetin messaes

    restructure the content accordin to user input etc..

    Examples* &nline shoppin stores,

    search enines

    email

    chat, communit" portals etc.

  • 7/25/2019 CS00

    18/36

    2"namic we% pae

    1%

    2"namic We% sites make use of (ser)er*side tec%nolo$y+.

    0erver)side technoloies add an extra la"erto the static we% pae that ena%les the&ebSer)erto enerate TM/ on the B".

    The we% server will 1rst

    interpret the server)side code present in

    we% paes, enerate the appropriate TM/ and then

    send the response to the we% %rowser.

  • 7/25/2019 CS00

    19/36

    ow re 2"namic We% (aes0erved?

    1

    CLENT

    *E- SERVER

    . T%e &eb browser

    sends a re-uest

    . &eb Ser)er collects t%e contents/code ! 0TM12 of t%e web pa$e

    and parses t%e contents to

    produce 0TM1.

    3. Browser processes

    0TM1 and displays

    pa$e

    4. T%e &eb Ser)er

    searc%es for t%e

    re-uested pa$e 5. T%e 0TM1 stream issent back to t%e

    re-uestin$ browser

  • 7/25/2019 CS00

    20/36

    Introduction to ASP.NET

  • 7/25/2019 CS00

    21/36

    +ntroduction to 0(.NET

    1

    0(.NET is part of the Microsoft .NET framework0(.NET is an e3ective and Bexi%le technolo" for

    creatin interacti)e and dynamic web pa$es.

    +t is a converence of two ma'or Microsoft

    technoloies*6cti)e Ser)er 'a$es /6S'2

    ctive 0erver (aes is MicrosoftCs server sidescriptin technolo" for %uildin d"namic we%

    paes. .NET Framework

    The .NET Framework is a suite of technoloiesdesined %" Microsoft where proram developmenttakes place.

  • 7/25/2019 CS00

    22/36

    +ntroduction to 0(.NET

    +t is %uilt on .NET ommon /anuae Runtime

    0(.NET *

    (rovides %etter user authentication

    as %etter lanuae support.

    as a lare set of new controls 6we% controls8

    7ses compiled code, which increases the

    performance of the applications

    +t is proramma%le usin an" of the .NETlanuaes 6=4.NET,

  • 7/25/2019 CS00

    23/36

    Workin of an 0(.NETpplication

    3

    To execute an 0(.NET 1le, the

    followin steps arefollowed*

    D. we% %rowser sends areuest for an 0(.NET 1leto the we% server %" usin

    a 7R/.

    #.The we% server receivesthe reuest and retrievesthe appropriate 0(.NET 1lefrom the disk or memor".

    :.The we% server forwardsthe 1le to the 0(.NETscript enine forprocessin.

    C18ENT

    &EB

    SE9VE9

    6S'.NET

    Script

    En$ine

    Workin of an 0( NET

  • 7/25/2019 CS00

    24/36

    Workin of an 0(.NETpplication

    4

    . The 0(.NET script eninereads the 1le from top to%ottom and executes it.

    G. The processed 0(.NET 1leis enerated as an TM/document and the0(.NET script eninesends the TM/ pae to

    the We% server.

    ;. The We% server thensends the TM/ code tothe client which interprets

    the output and displa"s it.

    C18ENT

    &EB

    SE9VE9

    6S'.NET

    Script

    En$ine

  • 7/25/2019 CS00

    25/36

    dvantaes of 0(.NET

    7

    Eas" (rorammin Model

    Flexi%le /anuae &ptions

    ompiled Execution

    Rich &utput achin We%)Farm 0ession 0tate

    Enhanced Relia%ilit"

    Master (aes

    Themes +mproved 0ecurit"

    We% 0ervices

    +mproved (erformance and 0cala%ilit"

  • 7/25/2019 CS00

    26/36

    =isual 0tudio #$$A +2E

    Statu -a

    Too! -o8

    5enu -a

    So!ution

    E8p!oe

    &opetie

    *in"o+

    Document

    +in"o+

    Tit!e -a

    reatin a New We%

  • 7/25/2019 CS00

    27/36

    reatin a New We%pplication

    2

    To start a new %eb &pplication in ' )**+, lic! the Create Web Site

    b#tton on the tart page or elect -ile /ew %eb ite

    The /ew %eb ite allows

    yo# to choose0

    Teplates Lang#age for creating an

    application

    Location where the application

    will be created

  • 7/25/2019 CS00

    28/36

    reatin a New pplication6ontinued8

    %

    &fter yo# create a new %eb &pplication, 1efa#lt.aspx page is added to this

    %ebsite. To 2enae this page, Selectthe page fro the %ebsite node in the

    Solution Explorer Right Click Rename.

    -iles can be added to the 3ro4ect,

    #sing ol#tion 5xplorer0

    2ight clic! on the pro4ect node, in

    the Solution Explorer,and select

    the optionAdd New Item.

    TheAdd New Itemwindow will

    pop#p.

    elect the type of file (ite" to be

    added and clic! on &dd.

  • 7/25/2019 CS00

    29/36

    0olution Explorer

    3resents a tree view tructureof filespresent in the pro4ect.

    6y defa#lt a /ew %ebsite will contain0

    &n &pp71ata folder

    & 1efa#lt.aspx page (incl#ding

    1efa#lt.aspx.cs"

    To 6ie+ So!ution E8p!oe9

    Select!iew: SolutionExplorer

    82

    "rebuttonCtrl#W,S

  • 7/25/2019 CS00

    30/36

    0olution Explorer6ontinued8

    3$

    The Toolbar at the top of ol#tion 5xplorer enables vario#s tas!s.

    &opetieNet

    Re!ate"

    ,i!e

    Vie+

    DeigneAS&.NET

    Configuation

    Refe;

    Co"e

    Cop/ *e0ite

  • 7/25/2019 CS00

    31/36

    Tool%ox

    31

    To add controls in the $eign Window#se

    %oolbox.

    There are vario#s tooltabavailable in the

    Toolbox.

    The controls in the I15 are presented in a

    hierarchical anner (e.g., tandard Tab, 1ata Tab,

    'alidation, /avigation, %eb3arts etc.".

    1epending on the type of pro4ect (application" the

    toolboxtabwillvar&.

    To view the tool box0

    Selecten#!iew: %oolbox

    'R

    3ressb#ttonsCtrl#Alt#( or Ctrl#W, (

    9o# can also view the controls as icons by right:

    clic!ing on the toolbox yo# want to change and

    deselecting the List 'iew.

  • 7/25/2019 CS00

    32/36

    (roperties Window

    3

    To config#re a control0 lic! once to select it

    "re)*orelectmenu!iew> "ropertie

    window

    Modify the appropriate properties in the window There are vario#s options provided for viewing

    the properties of the selected control, s#ch as0 Categori+edview

    Alphabeticalview

    "ropertieview(deault" Event!iew

    "ropert& page

    To vieworchangethepropertieand eventof a selected control d#ring

    design #se the "ropertieWindow

  • 7/25/2019 CS00

    33/36

    ddin an Event

    33

    5vents can be added to

    the code in one of three

    ways0

    -. $oubleclickinga controlin

    design view

    . %&pingthe code an#ally;. electing the5vents Icon

    and do#ble clic!ing the

    re

  • 7/25/2019 CS00

    34/36

    (ro'ect 0ettins

    34

    RightClickonthe ormyo# want set as

    the start#p page in the SolutionExplorer.

    elect option SetAStart"age.

    etting Startup"age/

    Startup"ro0ect(In case of #ltiplepro4ects"0

    RightClickon"ro0ectto set as start#p

    pro4ect in the SolutionExplorer.

    elect 8ption SetAStart1p"ro0ect.

    "ro0ectSettingcan be ad4#sted #sing

    vario#s options in the "ro0ect"ropertieen#or by #sing the

    SolutionExplorerwindow.

    %hee etting change baed on the

    t&pe o application developed.

  • 7/25/2019 CS00

    35/36

    Resources

    37

    =isual 0tudio #$$A We%sitehttp*HHmsdn.microsoft.comHvstudioH

    http://msdn.microsoft.com/vstudio/http://msdn.microsoft.com/vstudio/
  • 7/25/2019 CS00

    36/36

    Iuestions and omments

    3