ASP.NET Session 5


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

ASP.NET Session 5

  1. 1. Creating ASP.NET Web Form Session 5
  2. 2. Objectives • Learn how to create Web Form in .NET Platform using Visual Studio. • ASP.NET Page lifecycle.
  3. 3. Introduction • What is a Web Form? Ans:- A web form on a web page allows a user to enter data that is sent to a server for processing. And Server process the web page & send HTML stream to the client.
  4. 4. Steps to create ASP.NETWeb Form • To create a Web form in ASP.NET we need the Visual Studio.Net. • Under the ‘File’ menu we need to click on New-Web Site or we can simply press Shift+Alt+N from the keyboard. • A new window will appear. The name of the window will be ‘New Web Site’. It will look like this…
  5. 5. Steps to create a ASP.NETWeb Form(Contd.) • If we press on ‘Ok’ the ‘Default.aspx” window will generate where the HTML code will be written. • It calls the ‘Code-behind’. • It will be look like this…
  6. 6. Steps to create ASP.NETWeb Form(Contd.) • After that we have to put the mouse pointer over the Solution Explore. • On the Solution Explorer we need to double click on ‘Default.aspx.cs’ option under the ‘Default.aspx’. • It will open the C# devolvement window. Here we can write the C# coding for the Web site. • It calls the ‘Code inline’.
  7. 7. Steps to create ASP.NETWeb Form(Contd.) • Now we need to design our Web site. • For that we need to go to ‘Designer’ pane. • It may be find on the Solution Explore. • Using the dedicated Toolbox option we can add numerous controls on the ‘Design’ pane.
  8. 8. Steps to create ASP.NETWeb Form(Contd.) • Let us create the simple ‘Hello World’ programming for our first ASP.NET Web form. • On that program we will understand what we can do on the ‘Design’ pane. • The first page will show us the ‘Hello World’ message on the web browser without any controls. • It will be like this…
  9. 9. Steps to create ASP.NET Web Form(Contd.) • The code for the web form will be…
  10. 10. • Now we will format the output on the ‘Design’ window using a simple control- Label control. • It will look like this…..
  11. 11. Steps to create ASP.NET Web Form(Contd.) • The code for the web form will be…
  12. 12. Sequence of ASP.NET events 1)Page Init 2)Page Load 3)Controls Events 4)Page Unload events Page Init events only occurs when 1st time the page is started, But Page Load occurs in subsequent request of the page. ** Page Load event guarantees that all controls are fully loaded.
  13. 13. Summary • Web Page Created. • Steps of web page creation.