Creating first ASP.NET web application

1. Select File => New Project
2. Then you can either use C# or Visual Basic (select web) to develop ASP.NET web applications.
3. Then Select ASP.NET Web Application
4. Give your project name and solution name.
5. Select the location, where you want the solution to be created.
6. Click OK.




    


A project will be appear below image



At this point right click WebApplication1 and then 
1. Add=>New Item  
2.Select Web form
3.Give your WebForm name.
4.Finally click Add.


Web Forms: WebForms has the extension of .aspx. A web form also has a code behind and designer files. Code behind files has the extension of .aspx.cs (if c# is the programming language) or .aspx.vb (if vb is the programming language). Designer files contains the extension of .aspx.designer.cs (if c# is the programming language) or.aspx.designer.vb (if visual basic is the programming language). 


A WebForms HTML can be edited in Source or Design mode.



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    </div>
    </form>
</body>

</html>


Write something like Hello World then Press F5.

No comments:

Post a Comment