Asp.Net
How to Host a Website on IIS: Setup & Deploy Web Application
What is IIS? IIS or Internet Information Server is the server used to host .Net web applications. IIS is...
Let's look at an example of how we can implement a simple "hello world" application. For this, we would need to implement the below-mentioned steps.
Step 1) The first step involves the creation of a new project in Visual Studio. After launching Visual Studio, you need to choose the menu option New->Project.
Step 2) The next step is to choose the project type as an ASP.Net Web application. Here we also need to mention the name and location of our project.
Step 3) In the next screen, you have to choose the type of ASP.net web application that needs to be created. In our case, we are going to create a simple Web Form application.
If the above steps are followed, you will get the below output in Visual Studio.
Output:-
In the Solution Explorer, you will be able to see the DemoApplication Solution. This solution will contain 2 project files as shown above. At the moment, one of the key files in the project is the 'Global.asax.cs'. This file contains application specific information. In this file, you would initialize all application specific variables to their default values.
Step 4) Now, it's time to add a Web Form file to the project. This is the file which will contain all the web-specific code for our project.
Step 5) In the next screen we are going to be prompted to provide a name for the web form.
Automatically Visual Studio will create the Demo Web Form and will open it in Visual Studio.
Step 6) The next step is to add the code, which will do the work of displaying "Hello World." This can be done by just adding one line of code to the Demo.aspx file.
<html xmlns="www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <%Response. Write( "HeIIo World"); %> </div> </form> </body> </html>
Code Explanation:-
If you follow all of the above steps and run your program in Visual Studio, you will get the following output.
Output:-
From the output, you can clearly see that 'Hello World' was displayed in the browser.
What is IIS? IIS or Internet Information Server is the server used to host .Net web applications. IIS is...
Accessing Data from a database is an important aspect of any programming language. It is necessary for any...
In ASP.Net, it is possible to create re-usable code. The re-usable code can be used in many places...
$20.20 $9.99 for today 4.6 (118 ratings) Key Highlights of ASP.NET Tutorial PDF 157+ pages eBook...
Download PDF 1) What is Web API? WebAPI is a framework which helps you to build/develop HTTP...
What is WCF? WCF stands for Windows Communication Foundation. It is used to create a distributed and...