ASP.net Tut Web Form

Embed Size (px)

Citation preview

  • 8/9/2019 ASP.net Tut Web Form

    1/19

     ASP.NET programming tutorial for beginner – Part-I

    Introduction

    The term .Net gives us a feeling that it is something to do only with the Internet or networ related appli!ations.

    Though .Net provides strong environment for !reating su!h appli!ations" it is also possible to !reate many other types

    of appli!ations #$indows form based appli!ations" %onsole appli!ations" $indows !ustom !ontrols et!.&

    .Net is 'i!rosoft(s development model in whi!h software be!omes platform and devi!e independent and data be!omes

    available over the Internet. The .Net framewor is the heart of .Net. %entral to the .Net framewor is its runtime

    e)e!ution environment nown as the %ommon *anguage +untime #%*+& and the !ode running under the !ontrol of the

    %*+ is often termed as 'anaged %ode.

    In this tutorial we will show how to !reate a dynami! data driven web appli!ation in .Net environment and we also

    fo!us on understanding basi! ASP.Net !omponents for web appli!ation.

    Problem Statement for this tutorial

    $e will !reate a web appli!ation whi!h ass user to provide user id and password #both are re,uired fields&.$e will

    store some user ids and !orresponding passwords in database table. If a user id and password mat!hes with thedatabase entry at the ba! end then the user will be redire!ted to $el!ome page" otherwise he she will be prompted

    a Invalid *ogin message.

    Approach

    $e will divide this into two parts. In first part we dis!uss how to !reate and design the web pages in S /001" how to

    add web !ontrols in the pages" available validation !ontrols and their features et!.

    In se!ond part we show the pro!edure to !onne!t the web appli!ation with S2* Server and dis!uss about the A34.Net

    !ontrols and finally !ompile and run the appli!ation to verify its !orre!tness.

    Requirements

    5 $indows 6P Professional with Servi!e Pa! /$indows ista

    5 Internet E)plorer 7 or laterAny $eb 8rowser

    5 isual Studio /009/001 Professional

    5 S2* Server /009/001 3eveloper Edition

    5 IIS #Internet Information Servi!e& version 9.0 or later

    :ere we have set up the e)ample with isual Studio /001 and S2* Server /009 environment. 8ut you !an also

    pro!eed with S /009 version.

    Creating the Web Application

    4n!e you laun!h the S /001 you will be presented with a window similar to the s!reen shot below;

  • 8/9/2019 ASP.net Tut Web Form

    2/19

    e!ts" as well as sear!h for help or resour!es. e!ts bo) at

    the left side of the page. This bo) !ontains the latest pro>e!ts on whi!h we have wored. e!t or open an e)isting pro>e!t that is not listed. The ?etting Started bo) allows you to !reate new

    pro>e!ts from e)isting !ode " !reate new web sites" pull up the 'S3N help appli!ation. If you !lose the Start page from

    3o!ument $indow you !an rea!tivate the Start Page by sele!ting iew-@4ther $indows-@Start Page option.

    Now !lose the Start Page and from the isual Studio 'enu go to

  • 8/9/2019 ASP.net Tut Web Form

    3/19

  • 8/9/2019 ASP.net Tut Web Form

    4/19

  • 8/9/2019 ASP.net Tut Web Form

    5/19

  • 8/9/2019 ASP.net Tut Web Form

    6/19

  • 8/9/2019 ASP.net Tut Web Form

    7/19

  • 8/9/2019 ASP.net Tut Web Form

    8/19

  • 8/9/2019 ASP.net Tut Web Form

    9/19

  • 8/9/2019 ASP.net Tut Web Form

    10/19

    5+e,uired

  • 8/9/2019 ASP.net Tut Web Form

    11/19

  • 8/9/2019 ASP.net Tut Web Form

    12/19

    ust one one Llabel( !ontrol whi!h will show a wel!ome message after su!!essful login.

    To add another web page in our pro>e!t >ust right !li! on the pro>e!t in the Solution E)plorer and sele!t LAdd NewItem( #Shown in

  • 8/9/2019 ASP.net Tut Web Form

    13/19

    e!t

    Now in the design view drag and drop a L*abel( !ontrol from the toolbo) and !hange the properties lie the atta!hedsnapshot.

  • 8/9/2019 ASP.net Tut Web Form

    14/19

    Creating the Database Table

    :ere we will !reate a table !alled L*oginTable( in our S2* Server. Please have a loo at

  • 8/9/2019 ASP.net Tut Web Form

    15/19

  • 8/9/2019 ASP.net Tut Web Form

    16/19

  • 8/9/2019 ASP.net Tut Web Form

    17/19

    e!t in solution e)plorer and press

  • 8/9/2019 ASP.net Tut Web Form

    18/19

  • 8/9/2019 ASP.net Tut Web Form

    19/19