04 APR

How to Create Website in ASP.NET

Hello Developers, Here is Article to Create Website in C# ASP.NET. Here i am using Microsoft Visual Studio and Microsoft SQL server. Let's Follow some important steps.

step 1 : Open Visual Studio.Go to File Tab –>Project –>Web –>ASP.NET Web Application–>Select Empty –>Check Web Forms and MVC–>OK. (project name = LoginTest).

step 2 : Right click on Project –>Add –>New Item –>Web –> Web Form Master page–>Name(Main.Master)–>Add.
Remove all Codes inside Main.master and Copy+Paste below codes.

                    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="LoginTest.Main" %>  <!DOCTYPE html> <html> <head runat="server">     <asp:ContentPlaceHolder ID="head" runat="server">     </asp:ContentPlaceHolder>   </head> <body>     <h1 align="center">Welcome to WebPage</h1>     <nav>         <p>             <a href="Home.aspx">Home</a>&nbsp;&nbsp;&nbsp;              <a href="about.aspx">About</a>&nbsp;&nbsp;&nbsp;&nbsp;             <a href="services.aspx">Services</a>&nbsp;&nbsp;&nbsp;&nbsp;             <a href="privacy.aspx">Privacy and Policy</a>&nbsp;&nbsp;&nbsp;&nbsp;             <a href="Registration.aspx" >Sign UP </a>&nbsp;&nbsp;&nbsp;&nbsp;             <a href="Login.aspx">Login</a>         </p>      </nav>     <form id="form1" runat="server">         <div>             <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">              </asp:ContentPlaceHolder>             <p align="center">This is Footer</p>         </div>     </form> </body> </html>                                      

step 3 : Right click on Project –>Add –>New Item –>Web –> Web Form with Master page–>Name(Home.aspx)–>Add.
Remove all Codes inside Home.aspx and Copy+Paste below codes.

                    <%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="LoginTest.Home" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">     <title>Welcome to Home Page</title> </asp:Content>  <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">     <div id ="banner">         <img src="image/edu.jpg"/>     </div>     <table >         <tr>             <td>                 <img src="image/Laptop.jpg" />                     </td>                           <h3 align="center"> Welcome To Website </h3>             <td>             <p>                 Blogger is Totally New Software Technology Learning Experiene.                 Here you learn by practice or steps by steps. We make lots of efforts to take                  tedium out of learning and make education a fun experience.                 Inside, you will find plenty of blogs or video  tutorials.             </p>               </td>         </tr>      </table> </asp:Content>                                      

step 4 : Right click on Project –>Add –>New Item –>Web –> Web Form with Master page–>Name(about.aspx)–>Add.
Remove all Codes inside about.aspx and Copy+Paste below codes.

                    <%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="about.aspx.cs" Inherits="LoginTest.about" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">     <title>About Us</title> </asp:Content>  <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">     <table>         <img src="image/about.png" />         <tr>              <td>                <h3>Our Mission </h3>             <p>                  Free Education is Our Basic Need! Our mission is to empower millions of developers worldwide by providing the latest unbiased news, advice, and tools for learning, sharing, and career growth. We're passionate about nurturing the next young                 generation and help them not only to become great programmers, but also exceptional human beings.              </p>                 </td>         </tr>         <tr>             <td>          <h3> About </h3>             <p>                   Blogger is Totally New Software Technology Learning Experiene.                 Here you learn by practice or steps by steps. We make lots of efforts to take                  tedium out of learning and make education a fun experience.                 Inside, you will find plenty of blogs or video  tutorials.             </p>                 </td>         </tr>      </table> </asp:Content>                                      

step 5 : Right click on Project –>Add –>New Item –>Web –> Web Form with Master page–>Name(services.aspx)–>Add.
Remove all Codes inside services.aspx and Copy+Paste below codes.

                    <%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="services.aspx.cs" Inherits="LoginTest.services" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">     <title>Services</title> </asp:Content>  <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">      <table>         <tr> <img src="image/Services.png" />             <td>                <h3>Website Services </h3>             <p>                   Our Goals To Online Free Training For Following Applications : LANGUAGES:PHP, C#, Java, Python, Perl, JavaScript, CSS, HTML5 CMS: Java: Alfresco, Liferay, OpenCms, OpenText DotNET: Umbraco, Sitecore, MS SharePoint PHP: WordPress, Drupal             </p>                 </td>         </tr>         <tr>             <td>          <h3>FRAMEWORKS AND LIBRARIES:</h3>             <p>   Java: Grails, Seam, Spring JS: AngularJS, React, Backbone.js, Knockout.js Node.js: Express PHP: Laravel, Symfony, Yii, Zend DotNET: ASP.NET, ASP.NET MVC, ASP.NET Ajax,ASP.NET Dynamic Data. Ruby: Rails, Sinatra Python: Django, Flask DATABASES: MySQL, Microsoft SQL Server, PostgreSQL, IBM DB2, Oracle, Mongo DB, Redis, Cassandra             </p>                 </td>         </tr>          </table> </asp:Content>                                      

step 6 : Right click on Project –>Add –>New Item –>Web –> Web Form with Master page–>Name(privacy.aspx)–>Add.
Remove all Codes inside about.aspx and Copy+Paste below codes.

                    <%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="privacy.aspx.cs" Inherits="LoginTest.privacy" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">     <title>Privacy</title> </asp:Content>  <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">     <table>         <tr>         <td>                  <h3> Privacy Policy </h3>             <p>                  Blogger takes your privacy seriously. We do not sell or redistribute any personal information.                 The Blogger website and mobile apps do not collect or store information about individual users.             </p>                 </td>         </tr>      </table> </asp:Content>                  

step 7 : Add Few Images in the Project.

Step 8 : Run Home.aspx File. Wooww. Your First project created.see below image.

Happy Programming…Thanks.