Tuesday, July 28, 2009

Asp .Net and Visual Web Developer Express Edition

Asp .Net is Microsoft's Web Application Framework meant for developing dynamic web sites and web Services.

Visual Web Developer Express Edition is the free web developement tool from Microsoft. This series of lessons are based on Visual Web Developer Express Edition. The examples will work perfectly fine in Visual Studio .Net.

Asp .Net Introduction and Button Control

Start Visual Web Developer or Visual Studio. Start a new project by selecting File, New Web Site.
Select Asp .Net Web site as shown in the figure below.

You will be greeted with the IDE (Integrated Developement). The IDE is very similar to other Visual Studio IDEs.

Inorder to add a control to the form double click on the control in the toolbox. Add a button to the form by double clicking a button in the toolbox. Set its id property to btnHello and Text Property to Hello

Double click on the button to go to the Button's Click event in the code window.
Asp .Net supports both Code Behind and Inline mode for coding. In Code Behing mode a separate file is created which will be holding the code. So if the asp .net page is Default.aspx another file called Default.asp.cs page will be holding the code.

Code behind is the preferred mode for coding. I will take up inline mode in a later blog.

Add the following code :

protected void btnHello_Click(object sender, EventArgs e)
Response.Write("Hello welcome to Asp .Net");

Now run the application by either clicking the run button or pressing F5. On clicking the button you will receice the Hello message as shown in the figure below.

Asp .Net TextBox

No comments:

Post a Comment