Q1]adding formatted text
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>Hi there visitor and welcome to planet worx</h1>
<p>we're glad you're<span class="style">paying a visit</span>to
<a href="http://www.PlanetWrox.com">WWW.PlanetWrox.com</a>
the coolest music community site on the internet.
</p>
<p>
Feel free to have a look around ;as there are lost of interesting<b>reviews and concert pictures</b>to be found here.</p>
</div>
</form>
</body>
</html>
******************************************************************************************************************************************************************************************
Q2]Calender
Ans:-
<title>Untitled Page</title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
background-color: #FFCCFF;
}
</style>
</head>
<body bgcolor="#99ccff">
<form id="form1" runat="server">
<div>
<table class="style1">
<tr>
<td class="style2">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>
<td class="style2">
<asp:Button ID="Button3" runat="server" BackColor="#FF0066"
BorderColor="#CC66FF" BorderStyle="Solid" ForeColor="#33CC33"
Text="Setdate" style="height: 26px" />
</td>
</tr>
<tr>
<td class="style2">
<asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC"
BorderColor="#FFCC66" DayNameFormat="Shortest"
Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px"
Width="220px" BorderWidth="1px" ShowGridLines="True">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<SelectorStyle BackColor="#FFCC66" />
<TodayDayStyle BackColor="#CCCCCC" />
<OtherMonthDayStyle ForeColor="#CC9966" />
<NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
<DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt"
ForeColor="#FFFFCC" />
</asp:Calendar>
</td>
<td class="style2">
<asp:Button ID="Button2" runat="server" BackColor="#FF66FF"
BorderColor="#3333CC" BorderStyle="Dotted" Text="Plain postback" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
OUTPUT:-
===============
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Label1.Text = DateTime.Now.ToString()
End Sub
********************************************************************************************************************************************************************************
Q3]Write a code for page redirect
Ans:-
<body>
<form id="form1" runat="server">
<p>
Enter name:-<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
Enter password:-<asp:TextBox ID="TextBox2" runat="server" TextMode="Password"></asp:TextBox>
</p>
<p>
<asp:Button ID="Button1" runat="server" Text="submit" Width="57px" />
</p>
<div>
</div>
</form>
</body>
</html>
OUTPUT:-
================
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "abc" And TextBox2.Text = "abc" Then
Response.Redirect("Default2.aspx")
Else
Response.Write("incorect username/password")
End If
End Sub
*****************************************************************************************************************************************************************************************
Q4]Calulation of two value
Ans:-
<body>
<form id="form1" runat="server">
<p>
Enter Name:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
address:
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</p>
<p>
Class :
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</p>
<p>
enter the</p>
<p id="textbox">
<asp:Button ID="Button1" runat="server" Text="Button" style="height: 26px" />
</p>
<p>
</p>
<div>
</div>
</form>
</body>
</html>
OUTPUT:-
===============
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Write("well come to my world " & TextBox1.Text)
End Sub
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
Response.Write("")
End Sub
************************************************************************************************************************************************************************************
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Response.Write(Val(TextBox1.Text) + Val(TextBox2.Text))
End Sub
End Class
***************************************************************************************************************************************************************************************
Q5]Click on button and show msg.
ANS:-
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
<h1> Hi there visitor and Welcome to planet wrox</h1>
<p>
We&# 39;re glad you &# 39;re<span class ="style1">paying a visit</span>to<a href=" http://www.planetwrox.com">www.PlanetWrox.com</a>,
the coolest music community site on the Internet.</p>
<p>
Feel Free to have a look around; as there are lost of interesting<b>reviews and concert pictuers</b>to be found here.</p>
</div>
</form>
</body>
</html>
VBW:-
===========
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Write("Hi there visitor and Welcome to planet wrox" + (Button1.Text))
End Sub
************************************************************************************************************************************************************************************************
5]Drow table and give link
ANs:-
<title>Untitled Page</title>
<style type="text/css">
.style1
{
width: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="style1">
<tr>
<td>
Bullet List</td>
<td>
<ul>
<li>Punk</li>
<li>Rock</li>
<li>Techno</li>
</ul>
</td>
</tr>
<tr>
<td>
Number List</td>
<td>
<ol>
<li>Jazz</li>
<li>Rap</li>
<li>Hard Rock</li>
</ol>
</td>
</tr>
<tr>
<td>
Link</td>
<td>
<a href ="Default.aspx">Go to the homepage</a></td>
</tr>
</table>
</div>
</form>
</body>
</html>
*********************************************************************************************************************************************
6]session and application
Ans:-
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" />
<br />
</form>
</body>
</html>
Default2 Page
==============
write vb code on pageload
VB Code
===========
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Session("name") = "VISHAL"
Application("class") = "pgdcsa"
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Redirect("default2.aspx")
On Default2 page
===================
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Write("application " & Application("class"))
Response.Write(<br/>)
Response.Write("session " & Session("name"))
End Sub
****************************************************************************************************************************************************
7]Code of querystring
Ans:-
Response.Redirect("default2.aspx?name=" & TextBox1.Text & "&class=" & TextBox2.Text)
*******************************************************************************************************************************************************
8]mail code in localhost
Ans:-
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
VB CODE:-
===================
Imports System.Net.Mail
Partial Class Default3
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim msg As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage("patelvishal@gmail.com", "pateldharti@gmail.com")
msg.Subject = "Sending mail"
msg.Body = "hi , my first mail"
Dim smtp As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient("localhost")
smtp.Send(msg)
Response.Write("mail sent")
End Sub
WEB Config:-
================
</runtime>
<system.net>
<mailSettings>
<smtp deliveryMethod ="SpecifiedPickupDirectory" from="bhumikags@yahoo.co.in">
<specifiedPickupDirectory pickupDirectoryLocation ="c:\temp"/>
</smtp>
</mailSettings>
</system.net>
----------------------------------------------------------------
Q1]Write a program to Display “Welcome to ASP.NET ” using message box, on label and on your page (Hint: use Response.write)
Ans:-
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default4.aspx.vb" Inherits="Default4" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server"></asp:Label>
<br />
<br />
Message:-<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
OUTPUT:-
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Response.Write("welcome to ASP.net" + Label1.Text)
MsgBox(TextBox1.Text)
End Sub
End Class
*****************************************************************************************************************************************
Q2]Write a program to get your name and email ID and display your name and email ID on the label of your page.
Ans:-
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default5.aspx.vb" Inherits="Default5" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server"></asp:Label>
<br />
<br />
Enter name:-<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<br />
Enter E-mail:-<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
</html>
OUTPUT:-
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Write("Your name is" + TextBox1.Text)
Response.Write("Your E-mail id is" + TextBox2.Text)
End Sub
********************************************************************************************************************************************
Q3]Write a program to take three text boxes and display the following:
Today is Thursday, April 05, 2012.
The time is 2:05:15 AM.
My browser is Firefox.
Ans:-
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default7.aspx.vb" Inherits="Default7" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Today date and time is:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<br />
Today day is:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<br />
Your Browesr is:<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
OUTPUT:
==============
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Text = (DateTime.Now.ToString("D"))
TextBox2.Text = (DateTime.Now.ToString("T"))
TextBox3.Text = (Request.Browser.Browser)
End Sub
*******************************************************************************************************************************
Q4]Make a simple web page and apply different font color, font using CSS.
Ans:-
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default5.aspx.vb" Inherits="Default5" %>
<!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">
<title>Untitled Page</title>
<style type="text/css">
.newStyle1
{
font-family: Arial, Helvetica, sans-serif;
font-size: xx-large;
font-weight: bold;
font-style: italic;
font-variant: normal;
text-transform: none;
color: #FF00FF;
}
.newStyle2
{
font-family: "Courier New", Courier, monospace;
font-size: large;
font-weight: bold;
font-style: oblique;
font-variant: normal;
color: #FF0000;
border: medium groove #00FF00;
}
</style>
</head>
<body>
<p class="newStyle1">
Hello PGDCSA-2</p>
<p class="newStyle2">
Welcome All PGDCSA student in Rollwala Computer Center</p>
<form id="form1" runat="server" class="newStyle2">
<div>
</div>
</form>
</body>
</html>
***********************************************************************************************************************************
Q5]Write a program which has two web pages and put hyperlink on both the pages to move from one page to another.
Ans:-
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<p style="font-size: medium; font-style: italic">
This is my Home Page</p>
<p style="font-size: medium; font-style: italic">
Enter your Name:-<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</p>
<p style="font-size: medium; font-style: italic">
Enter your password:-<asp:TextBox ID="TextBox2" runat="server"
TextMode="Password"></asp:TextBox>
</p>
<p style="font-size: medium; font-style: italic">
<asp:Button ID="Button1" runat="server" Text="Button" />
</p>
<p style="font-size: medium; font-style: italic">
<a href="Default2.aspx" >Go to the second page.</a> </p>
<p>
</p>
</form>
</body>
</html>
Defult2.aspx page
=====================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<p>
Enter Your application number:-<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
<a href="Default.aspx">Go to the first page</a></p>
<div>
</div>
</form>
</body>
</html>
OUTPUT
*********
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "vishal" And TextBox2.Text = "abc" Then
Response.Write("User name and password is correct Go to second page")
Else
MsgBox("Incorrect user name and password")
End If
End Sub
****************************************************************************************************************************************
Q6]Write a program which has two web pages and put a button on both the pages to move from one page to another.
Ans:-
Default1.aspx:-
=====================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default5.aspx.vb" Inherits="Default5" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<p>
My first page</p>
<form id="form1" runat="server">
<p>
Enter Your name:-<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
Enter your no:-<asp:TextBox ID="TextBox2" runat="server" TextMode="Password"></asp:TextBox>
</p>
<p>
<asp:Button ID="Button1" runat="server" Text="Button" />
</p>
<p>
</p>
<div>
</div>
</form>
</body>
</html>
DEFAULT2.ASPX
========================
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default6.aspx.vb" Inherits="Default6" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<p>
Fill the Form</p>
<form id="form1" runat="server">
<p>
Nmae:-<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</p>
<p>
Class:-<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</p>
<p>
<asp:Button ID="Button1" runat="server" Text="Button" />
</p>
<div>
</div>
</form>
</body>
</html>
OUTPUT
==============
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Redirect("default6.aspx")
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Redirect("default5.aspx")
End Sub
*************************************************************************************************************************************************************************
Q7]Develop a webpage which gives you a dropdown list to select breakfast, lunch or dinner. The 3 checkbox allows you to select soup, Gujarati Thali and Icecream. According to your selection, when you click the button Choice, it will display your selection of dropdown box and checkbox in (1) a message box (2) in a Label.
Ans:-
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Please enter your name:-<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<br />
Select Your menu:<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Lunch</asp:ListItem>
<asp:ListItem>Breakfast</asp:ListItem>
<asp:ListItem>Dinner</asp:ListItem>
</asp:DropDownList>
</div>
<p>
Select your item:<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem>Soup</asp:ListItem>
<asp:ListItem>Gujareti thali</asp:ListItem>
<asp:ListItem>Ice-cream</asp:ListItem>
</asp:CheckBoxList>
</p>
<asp:Button ID="Button1" runat="server" Text="submit" />
<br />
<br />
<asp:Label ID="Label1" runat="server"></asp:Label>
</form>
</body>
</html>
OUTOUT:-
==============
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = TextBox1.Text & "<br/>" & DropDownList1.Text & "<br/>" & CheckBoxList1.Text
MsgBox(TextBox1.Text & DropDownList1.Text & CheckBoxList1.Text)
********************************************************************************************************************************************************************
Q8]Create a webpage for calculator which allows user to enter two numbers and select four basic operations. The result will be display when user click on the calculate button. Clear button allows user to clear the values enter in textboxes.
Ans:-
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default4.aspx.vb" Inherits="Default4" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Enter number1:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>+</asp:ListItem>
<asp:ListItem>-</asp:ListItem>
<asp:ListItem>*</asp:ListItem>
<asp:ListItem>/</asp:ListItem>
</asp:DropDownList>
<br />
<br />
Enter number2:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<br />
OUTPUT:<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Calculate" />
<input type="reset" value="clear" />
</div>
</form>
</body>
</html>
OUTPUT:
===================
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If (DropDownList1.Text = "+") Then
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
ElseIf (DropDownList1.Text = "-") Then
TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
ElseIf (DropDownList1.Text = "*") Then
TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
Else
TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End If
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = " "
TextBox2.Text = " "
TextBox3.Text = " "
End Sub
*****************************************************************************************************************************************************************************************
Q7.]Write a simple program which use panel and wizard control.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default6.aspx.vb" Inherits="Default6" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True"
Text="Show panel" />
<asp:Panel ID="Panel1" runat="server" Height="50px" Visible="false" Width="125px">
<asp:Wizard ID="Wizard1" runat="server" Width="500px" ActiveStepIndex="1"
Height="66px">
<WizardSteps>
<asp:WizardStep runat="server" title="About You">
<asp:Label ID="Label1" runat="server" Text="Type your name"></asp:Label>
:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</asp:WizardStep>
<asp:WizardStep runat="server" title="Favorite language">
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Ready">
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
</asp:Panel>
</div>
<p>
</p>
<p>
</p>
</body>
</html>
OUTPUT
=================
Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
Panel1.Visible = CheckBox1.Checked
End Sub
================================================================================================================================================================================================
Que 1. Create a Form that Implements a Theme with the help of Skin File and Images.
Use your own creativity.
Source ::
default 1.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" BackColor="#CC99FF"
BorderColor="#3333CC" BorderStyle="Inset" Font-Bold="True" Font-Italic="True"
Font-Names="Comic Sans MS" Text="hello" Width="110px" />
</div>
</form>
</body>
</html>
default 2.
<form id="form1" runat="server">
<div>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
theame page.
body
{
background-image:url(http://www.popsci.com/sites/popsci.com/
files/styles/large_1x_/public/new-google-logo.jpg?itok=ZdIobGek);
}
.Button1
{
background-color:Aqua;
}
skinfile.
<asp:Button runat="server" BackColor="#CC99FF"
BorderColor="#3333CC" BorderStyle="Inset" Font-Bold="True" Font-Italic="True"
Font-Names="Comic Sans MS" Text="hello" Width="110px" />
**********************************************************************************
Que 2 : Create a Form that receives the user name, address, date, nationality, country
preferred for working and skill sets from the user and stores the user name in the
client using cookies. The country preferred data should appear in a dropdownlist
whereas, others should be entered in a textbox. Validate all the controls. The date
should appear between “1/1/2000” and “1/1/2090”.
Source 1 :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<div>
<table>
<tr>
<td>
NAME:</td>
<td>
<asp:TextBox ID="TextBox1" runat="server" Width="175px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="PLEASE ENTER YOUR NAME">*
</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
ADDRESS:</td>
<td>
<asp:TextBox ID="TextBox2" runat="server" Height="69px" TextMode="MultiLine">
</asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ErrorMessage="PLEASE ENTER YOUR YOUR ADDRESS" ControlToValidate="TextBox2">
*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
DATE</td>
<td>
<asp:TextBox ID="TextBox3" runat="server" Width="174px"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="TextBox3"
ErrorMessage="PLEASE ENTER DATE BETWEEN 1/1/2000 AND 1/1/2090"
MaximumValue="1/1/2090" MinimumValue="1/1/2000">ENTER DATE IN D/M/YYYY
FORMATE</asp:RangeValidator>
</td>
</tr>
<tr>
<td>
NATIONALITY:</td>
<td>
<asp:TextBox ID="TextBox4" runat="server" Width="174px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="TextBox4" ErrorMessage="ENTER YOUR NATIONALITY">*
</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
COUNTRY</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Height="18px" Width="170px">
<asp:ListItem>INDIA</asp:ListItem>
<asp:ListItem>PAKISTAN</asp:ListItem>
<asp:ListItem>BANGLADESH</asp:ListItem>
<asp:ListItem>SHRILANKA</asp:ListItem>
<asp:ListItem>NEPAL</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
PREFERED FOR WORKING</td>
<td>
<asp:TextBox ID="TextBox5" runat="server" Width="171px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ControlToValidate="TextBox5" ErrorMessage="ENTER WORKING DETAIL">*
</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
SKILS</td>
<td>
<asp:TextBox ID="TextBox6" runat="server" Width="174px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ControlToValidate="TextBox6" ErrorMessage="ENTER UOUR SKILLS">*
</asp:RequiredFieldValidator>
<br />
<asp:Button ID="Button1" runat="server" Text="SUBMIT" />
</td>
</tr>
<tr>
<td" colspan="2">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
.VB
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim data As New HttpCookie("userdata")
data.Values("name") = TextBox1.Text
data.Values("address") = TextBox2.Text
data.Values("date") = TextBox3.Text
data.Values("nationality") = TextBox4.Text
data.Values("country") = DropDownList1.SelectedItem.ToString
data.Values("working") = TextBox5.Text
data.Values("skill") = TextBox6.Text
data.Expires = DateTime.Now.AddYears(1)
Response.Cookies.Add(data)
Response.Redirect("default2.aspx")
End Sub
End Class
**********************************************************************************
Que : 4 Create a User control component that receives two numbers from the user through a Web Form,
and based on the user’s selection it adds or subtracts the two numbers and returns the result
to the Web Form. The result should be displayed in the Web Form.
Source :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" placeholder="Enter 1st value"></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>+</asp:ListItem>
<asp:ListItem>-</asp:ListItem>
<asp:ListItem>*</asp:ListItem>
<asp:ListItem>/</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="TextBox2" runat="server" placeholder="Enter 2nd value"></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
<br />
<br />
<asp:TextBox ID="TextBox3" runat="server" placeholder="Your Ans is"></asp:TextBox>
</div>
</form>
</body>
</html>
Vb:
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If DropDownList1.Text = "+" Then
TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
ElseIf DropDownList1.Text = "-" Then
TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
ElseIf DropDownList1.Text = "*" Then
TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
ElseIf DropDownList1.Text = "/" Then
TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
End If
End Sub
End Class
**********************************************************************************
Que : 5 Create a Webpage which displays the use of Menu Control, Tree view control
and Sitemappath control,You can design the website as per your creativity.
Source :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<br />
Menu :-<asp:Menu ID="Menu1" runat="server" Height="147px" Width="111px">
<Items>
<asp:MenuItem Text="Commerce" Value="Commerce">
<asp:MenuItem Text="A/c" Value="New Item"></asp:MenuItem>
<asp:MenuItem Text="State" Value="State"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Science" Value="Science">
<asp:MenuItem Text="Biology" Value="Biology"></asp:MenuItem>
<asp:MenuItem Text="Chemistry" Value="Chemistry"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Arts" Value="Arts">
<asp:MenuItem Text="B.A" Value="B.A"></asp:MenuItem>
<asp:MenuItem Text="History" Value="History"></asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>
</div>
<p>
</p>
<p>
Tree View :-</p>
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="Primary" Value="Primary">
<asp:TreeNode Text="1 to 7" Value="1 to 7"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Secondry" Value="Secondry">
<asp:TreeNode Text="8 To 9" Value="8 To 9"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Higher Secondary" Value="Higher Secondary">
<asp:TreeNode Text="10 To 12" Value="10 To 12"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
<p>
</p>
<p>
</p>
</form>
</body>
</html>
**********************************************************************************
Que : 6 Develop a Web page which allows you to build Flicker free pages, which has a
Timer control and a Date , where date gets automatically updated , every time.
Source :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" Interval="1000">
</asp:Timer>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
VB :
Partial Class Default3
Inherits System.Web.UI.Page
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = DateTime.Now.ToString
End Sub
End Class
**********************************************************************************
Que : 7 Create a Web page which has two TextBox controls, one ListBox control, one
Button control, and one CompareValidator control in an .aspx file. The
check_operator() function sets the operator of the CompareValidator control equal
to the selected operator in the ListBox control, then it validates the
CompareValidator control. If validation fails, the text "Validation Failed!" will be
displayed in red on a yellow background in the CompareValidator control.
Source :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<p>
Enter no1 :-<asp:TextBox ID="TextBox1" runat="server" Width="108px"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="TextBox1" ControlToValidate="TextBox3"
ErrorMessage="Value not match">*</asp:CompareValidator>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>></asp:ListItem>
<asp:ListItem><</asp:ListItem>
<asp:ListItem>=</asp:ListItem>
</asp:DropDownList>
Enter no2 :-<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</p>
<div>
<asp:Button ID="Button1" runat="server" Height="47px" Text="Cantrol"
Width="89px" />
</div>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
</form>
</body>
</html>
**********************************************************************************
Que : 8 Create a Web Page which will allow the user to Send mail.It should
have GUI for entering details like “To”, “From” and “Message”.
Source :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
TO:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
MESSAGE:<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="SEND" />
<br />
</div>
</form>
</body>
</html>
Vb :
Imports System.Net.Mail
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim msg As New MailMessage()
msg.Body = TextBox3.Text
msg.From = New MailAddress("pgdcsa.stu@gmail.com")
msg.To.Add(New MailAddress(TextBox1.Text))
Dim smtpclass As SmtpClient = New SmtpClient()
smtpclass.EnableSsl = True
smtpclass.Send(msg)
End Sub
End Class
web.config :
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="pgdcsa.stu@gmail.com">
<network host="smtp.gmail.com" userName="pgdcsa.stu@gmail.com" password="pgdcsa@1234"/>
</smtp>
</mailSettings>
</system.net>
</configuration>
0 comments:
Post a Comment