+ All Categories
Home > Technology > ASP.NET Session 5

ASP.NET Session 5

Date post: 20-Jun-2015
Category:
Upload: sisir-ghosh
View: 125 times
Download: 1 times
Share this document with a friend
Popular Tags:
22
Creating ASP.NET Web Form Session 5
Transcript
Page 1: ASP.NET Session 5

Creating ASP.NET Web Form

Session 5

Page 2: ASP.NET Session 5

Objectives

• Learn how to create Web Form in .NET Platform using Visual Studio.

• ASP.NET Page lifecycle.

Page 3: ASP.NET Session 5

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.

Page 4: ASP.NET Session 5

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…

Page 5: ASP.NET Session 5
Page 6: ASP.NET Session 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…

Page 7: ASP.NET Session 5
Page 8: ASP.NET Session 5

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’.

Page 9: ASP.NET Session 5
Page 10: ASP.NET Session 5

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.

Page 11: ASP.NET Session 5
Page 12: ASP.NET Session 5
Page 13: ASP.NET Session 5

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…

Page 14: ASP.NET Session 5
Page 15: ASP.NET Session 5

Steps to create ASP.NET Web Form(Contd.)

• The code for the web form will be…

Page 16: ASP.NET Session 5
Page 17: ASP.NET Session 5

• Now we will format the output on the ‘Design’ window using a simple control- Label control.

• It will look like this…..

Page 18: ASP.NET Session 5
Page 19: ASP.NET Session 5

Steps to create ASP.NET Web Form(Contd.)

• The code for the web form will be…

Page 20: ASP.NET Session 5
Page 21: ASP.NET Session 5

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.

Page 22: ASP.NET Session 5

Summary

• Web Page Created.• Steps of web page creation.


Recommended