Hello World Web Application In C#


#C#  #ASP.NET #Web


Web Application


In computing, a web application or web app is a client–server computer program which the client (including the user interface and client-side logic) runs in a web browser. Common web applications include webmail, online retail sales, online auctions, wikis, instant messaging services and many other functions.



‘Hello World’ in a web application with web form


Now we will create a very simple web application. In this application, user will click on a button ‘Show’ and a label will appear displaying ‘Hello World’.

Steps:
1.      Start Microsoft Visual Studio 2013
2.      Click File>New>Project
3.      Select Web>ASP.NET Web Application
4.      Write appropriate name in ‘Name’ box, change the destination folder of the project directory by clicking the ‘Browse’ button
5.      Click ‘Ok’ button

 You will get the following picture in your window

6.      You have to select Empty Templete at first and also check Web Forms.    
7.      Click ‘Ok’ button
8.      Now you have to add Web Form .

You will get the following picture in your window
if you want to design vew then you click Design button.
9.      Now drag and drop a button from toolbox situated at the left side of your development window .(if it is not appeared there, Click View>ToolBox)­
10.      Click on the button
11.      Change the Text Property of the button into ‘Show’



This will looks like the following picture.

12.      Double click on the button of the form and write the following code snippet
           private voidshowButton_Click(object sender, EventArgs e)
            {
              showLabel.Text ("Hello World");
            }

13.      Now run the application bu clicking on the debug button or pressing F5.
14.      Click on the ‘Show’ button of the running application.
15.      A messagebox will appear.
     You will get the following picture


إرسال تعليق

أحدث أقدم