Initial Chamber
Step 1
Open Visual Studio 2010 and create an empty website, name it Calendar_demo.
Step 2
In Solution Explorer you get your empty website, then add a Web Form as in the following.
For Web Form:
Calendar_demo (Your Empty Website) and right-click to Add New Item as Web Form, name it calendar_demo.aspx.
Design Chamber
Step 3
Now open your calendar_demo.aspx file and make some design code to build up your application like the following.
Calendar_demo.aspx
Your design will look like the following.
Code Chamber
Step 4
Open your calendar_demo.aspx.cs file, where we will write the following code for printing the data that you provided in the TextBox in label.
Calendar_demo.aspx.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
-
-
- public partial class _Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
-
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
-
-
- Label1.Text = "My Name is:" + TextBox1.Text + "</br>" + "My Father Name is:" + TextBox2.Text + "</br>" + "My Mothe Name is:" + TextBox3.Text + "</br>" + TextBox4.Text + "My DOB is:" + DropDownList1.SelectedItem.Text + "</br>" + "My Phone No is:" + TextBox5.Text + "</br>";
- Label1.ForeColor = System.Drawing.Color.Green;
-
- }
-
- }
Output ChamberHere it will automatically get your age by giving your date of birth.
I hope you like this. Have a nice day, Thank you for reading!