Using ASP.NET Web Form you can create dynamic websites very easily; it provides you everything to build a powerful UI-driven site rapidly.
Here you learn how to create a asp.net web form and receive user input and submit the form.
Remember when you create a aspx page in asp.net, the page itself a form, and at submit button click event you can capture all user input in code behind (aspx.cs )
Step 1: Create a Project of type "Asp.Net Web Forms Application"
Now you once you click "Ok", a new web form project will be created, by default there will be some pages like home, about, contact etc.
But still we add another new page so you learn how to add a new page / form, Remember in asp.net web forms application whenever you add a new page, that’s a form, so don't get confused by "form" and "page" terminology, both are actually same though technically they have different characteristic.
Add Web Form in Asp.net Project
Step 2: Create a new Web Form
A new web form page is added in your project with following code
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="company.aspx.cs" Inherits="WTRWebForm.company" %>
<title>Web Form </title>
<form id="form1" runat="server">
Notice, one form tag has been added in your webpage.
Now probably you have a master page in your project, so you need to add the master page reference in this page also.
Remember, if you want to add master page reference in this page, you need to remove the form tag from this page
, because master page has a form tag, and in web page you can have only one form tag
Web form with Master page in asp.net
To add master page in your web form page, simply go to page directive and set the MasterPageFile name. by default there is one masterpage called "Site.Master" is created with project. but you can add a new master page as per your need.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Fileupload.aspx.cs"
MasterPageFile="~/Site.Master" Inherits="WTRWebForm.Fileupload" %>
After adding master page reference you need to remove all other html code, now everything should come under following asp:Content tag
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
// all page content goes here.