23BCA106 Web Application Development using ASP.NET – C# DSC-M-BCA-245 P
1)Create a form which takes user name in
TextBox control. On the click event of the
button, name of the user and current date &
time will be displayed on the title bar of the
web page. (Using Literal control). Also show
the use of CSS property to change the text
color of a button control using internal and
external CSS.
Source-Code :
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="pro1_1.aspx.cs" Inherits="pro1_1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
Patel Khushi Vijaybhai
,23BCA106 Web Application Development using ASP.NET – C# DSC-M-BCA-245 P
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button"
onclick="Button1_Click" />
<br />
<br />
<br />
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
</div>
</form>
</body>
</html>
Code-Behind :
public partial class pro1_1 : System.Web.UI.Page
{
Patel Khushi Vijaybhai
,23BCA106 Web Application Development using ASP.NET – C# DSC-M-BCA-245 P
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Literal1.Text = DateTime.Now.ToString("T");
}
}
Output :
2) Design a web page to take eno, empid,
ename, username, password, confirm
Patel Khushi Vijaybhai
, 23BCA106 Web Application Development using ASP.NET – C# DSC-M-BCA-245 P
password, Date of birth, gender, city, email,
mobile number, Experience years. Do
validations as below:
• All fields are compulsory
• EmpID as "EMP0001" i.e. first 3 characters "EMP" with 4
digits
• Name should contain only alphabets.
• Minimum length of password should be 8
• Birth date should be between 1985 and 2000. •
Experience years between 2 to 10.
• Email should be in valid format.
• Mobile number should of exactly 10 digits.
• City compulsory "Ahmedabad"
• Give demo of validation summary
Source-Code :
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="pro2practise.aspx.cs" Inherits="pro2practise" %>
Patel Khushi Vijaybhai
1)Create a form which takes user name in
TextBox control. On the click event of the
button, name of the user and current date &
time will be displayed on the title bar of the
web page. (Using Literal control). Also show
the use of CSS property to change the text
color of a button control using internal and
external CSS.
Source-Code :
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="pro1_1.aspx.cs" Inherits="pro1_1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
Patel Khushi Vijaybhai
,23BCA106 Web Application Development using ASP.NET – C# DSC-M-BCA-245 P
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button"
onclick="Button1_Click" />
<br />
<br />
<br />
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
</div>
</form>
</body>
</html>
Code-Behind :
public partial class pro1_1 : System.Web.UI.Page
{
Patel Khushi Vijaybhai
,23BCA106 Web Application Development using ASP.NET – C# DSC-M-BCA-245 P
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Literal1.Text = DateTime.Now.ToString("T");
}
}
Output :
2) Design a web page to take eno, empid,
ename, username, password, confirm
Patel Khushi Vijaybhai
, 23BCA106 Web Application Development using ASP.NET – C# DSC-M-BCA-245 P
password, Date of birth, gender, city, email,
mobile number, Experience years. Do
validations as below:
• All fields are compulsory
• EmpID as "EMP0001" i.e. first 3 characters "EMP" with 4
digits
• Name should contain only alphabets.
• Minimum length of password should be 8
• Birth date should be between 1985 and 2000. •
Experience years between 2 to 10.
• Email should be in valid format.
• Mobile number should of exactly 10 digits.
• City compulsory "Ahmedabad"
• Give demo of validation summary
Source-Code :
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="pro2practise.aspx.cs" Inherits="pro2practise" %>
Patel Khushi Vijaybhai