Lab Manual
Lab Manual
CERTIFICATE
/ / Darshak B. Mehta
PRACTICAL: 1
AIM: Getting acquainted with Visual Studio environment. (Create new
web project, open existing web project, building website, and study of
toolbars, menu etc.)
This walkthrough provides you with an introduction to Microsoft Visual Web Developer. It
guides you through creating a simple page by using Visual Web Developer, illustrating the basic
techniques of creating a new page, adding controls, and writing code.
In this part of the walkthrough, you will create a Web site and add a new page to it. You will also
add HTML text and run the page in your Web browser.
For this walkthrough, you will create a file system Web site that does not require that you work
with Microsoft Internet Information Services (IIS). Instead, you will create and run your page in
the local file system.
A file system Web site is one that stores pages and other files in a folder that you choose
somewhere on your local computer. Other Web site options include a local IIS Web site, which
stores your files in a subfolder of the local IIS root (typically, \Inetpub\Wwwroot\). An FTP site
stores files on a remote server that you gain access to across the Internet by using File Transfer
Protocol (FTP). A remote site stores files on a remote server that you can access across a local
network. For more information, see Walkthrough: Editing Web Sites with FTP in Visual Web
Developer. Also, Web site files can be stored in a source control system such as Visual
SourceSafe. For more information, see Introducing Source Control.
The New Web Site dialog box appears, as shown in the following screen shot.
When you create a Web site, you specify a template. Each template creates a Web
application that contains different files and folders. In this walkthrough, you are creating
a Web site based on the ASP.NET Web Site template, which creates some folders and a
few default files.
4. In the Location box, select the File System box, and then enter the name of the folder
where you want to keep the pages of your Web site.
The programming language you choose will be the default for your Web site. However,
you can use multiple languages in the same Web application by creating pages and
components in different programming languages.
6. Click OK.
Visual Web Developer creates the folder and a new page named Default.aspx. When a
new page is created, by default Visual Web Developer displays the page in Source view,
where you can see the page's HTML elements. The following screen shot shows the
Source view of a default Web page.
Before you proceed with working on the page, it is useful to familiarize yourself with the Visual
Web Developer development environment. The following illustration shows you the windows
and tools that are available in Visual Web Developer.
This diagram shows default windows and window locations. The View menu allows you to
display additional windows, and to rearrange and resize windows to suit your preferences. If
changes have already been made to the window arrangement, what you see will not match the
diagram.
Diagram of Visual Web Developer environment
To familiarize yourself with the Web designer in Visual Web Developer
Examine the preceding illustration and match the text to the following list, which
describes the most commonly used windows and tools. (Not all windows and tools that
you see are listed here, only those marked in the preceding illustration.)
o Toolbars. Provide commands for formatting text, finding text, and so on. Some
toolbars are available only when you are working in Design view.
o Solution Explorer. Displays the files and folders in your Web site.
o Document window. Displays the documents you are working on in tabbed
windows. You can switch between documents by clicking tabs.
o Properties window. Allows you to change settings for the page, HTML elements,
controls, and other objects.
o View tabs. Present you with different views of the same document. Design view
is a near-WYSIWYG editing surface. Source view is the HTML editor for the
page. Split view displays both the Design view and the Source view for the
document. You will work with the Design and Source views later in this
walkthrough. If you prefer to open Web pages in Design view, on the Tools
menu, click Options, select the HTML Designer node, and change the Start Pages
In option.
o Toolbox. Provides controls and HTML elements that you can drag onto your
page. Toolbox elements are grouped by common function.
o Server Explorer/Database Explorer. Displays database connections. If Server
Explorer is not visible in Visual Web Developer, on the View menu, click Server
Explorer or Database Explorer.
When you create a new Web site, Visual Web Developer adds an ASP.NET page (Web Forms
page) named Default.aspx. You can use the Default.aspx page as the home page for your Web
site. However, for this walkthrough, you will create and work with a new page.
To add a page to the Web site
1. Close the Default.aspx page. To do this, right-click the tab containing the file name and
select Close.
2. In Solution Explorer, right-click the Web site (for example, C:\BasicWebSite), and then
click Add New Item.
3. Under Visual Studio installed templates, click Web Form. The following screen shot
shows the Add New Item dialog box.
In this walkthrough, you are creating a single-file page with the code and HTML in the
same page. The code for ASP.NET pages can be located either in the page or in a
separate class file. To learn more about keeping the code in a separate file, see
Walkthrough: Creating a Basic Web Page with Code Separation in Visual Web
Developer.
7. Click Add.
Visual Web Developer creates the new page and opens it.
In this part of the walkthrough, you will add some static text to the page.
1. At the bottom of the document window, click the Design tab to switch to Design view.
Design view displays the page that you are working on in a WYSIWYG-like way. At this
point, you do not have any text or controls on the page, so the page is blank except for a
dashed line that outlines a rectangle. This rectangle represents a div element on the page.
The following screen shot shows the text you typed in Design view.
Before you proceed with adding controls to the page, you can try running it. To run a page, you
need a Web server. In a production Web site, you use IIS as your Web server. However, to test a
page, you can use the ASP.NET Development Server, which runs locally and does not require
IIS. For file system Web sites, the default Web server in Visual Web Developer is the ASP.NET
Development Server.
The page is displayed in the browser. Although the page you created has an extension of
.aspx, it currently runs like any HTML page.
To display a page in the browser you can also right-click the page in Solution Explorer
and select View in Browser.
If the browser displays a 502 error or an error indicating that the page cannot be
displayed, you might need to configure your browser to bypass proxy servers for local
requests. For details, see How to: Bypass a Proxy Server for Local Web Requests.
In this part of the walkthrough, you will add a Button, a TextBox, and a Label control to the page
and write code to handle the Click event for the Button control.
You will now add server controls to the page. Server controls, which include buttons, labels, text
boxes, and other familiar controls, provide typical form-processing capabilities for your
ASP.NET Web pages. However, you can program the controls with code that runs on the server,
not the client.
This static HTML text is the caption for the TextBox control. You can mix static HTML
and server controls on the same page. The following screen shot shows how the three
controls appear in Design view.
Controls in Design View
Visual Web Developer offers you various ways to set the properties of controls on the page. In
this part of the walkthrough, you will set properties in both Design view and Source view.
1. Select the Button control, and then in the Properties window, set Text to Display Name,
as shown in the following screen shot.
Source view displays the HTML for the page, including the elements that Visual Web
Developer has created for the server controls. Controls are declared using HTML-like
syntax, except that the tags use the prefix asp: and include the attribute runat="server".
Page #: 10 | Government Polytechnic, Gandhinagar
Control properties are declared as attributes. For example, when you set the Text property
for the Button control, in step 1, you were actually setting the Text attribute in the
control's markup.
Note that all the controls are inside a <form> element, which also has the attribute
runat="server". The runat="server" attribute and the asp: prefix for control tags mark the
controls so that they are processed by ASP.NET on the server when the page runs. Code
outside of <form runat="server"> and <script runat="server"> elements is sent
unchanged to the browser, which is why the ASP.NET code must be inside an element
whose opening tag contains the runat="server" attribute.
3. Put the insertion point after asp:Label in the <asp:Label> tag, and then press
SPACEBAR.
A drop-down list appears that displays the list of properties you can set for a Label
control. This feature, referred to as IntelliSense, helps you in Source view with the syntax
of server controls, HTML elements, and other items on the page. The following screen
shot shows the IntelliSense drop-down list for the Label control.
Note:
You can display an IntelliSense drop-down list at any time by pressing CTRL+J.
5. Select a color for the Label control's text. Make sure you select a color that is dark
enough to read against a white background.
The ForeColor attribute is completed with the color that you have selected, including the
closing quotation mark.
For this walkthrough, you will write code that reads the name that the user enters into the text
box and then displays the name in the Label control.
Visual Web Developer switches to Source view and creates a skeleton event handler for
the Button control's default event, the Click event.
Note:
Double-clicking a control in Design view is just one of several ways you can create event
handlers.
Label1.
When you type the period after Label, Visual Web Developer displays a list of available
members for the Label control, as shown in the following screen shot.
VB
C#
5. Scroll down to the <asp:Button> element. Note that the <asp:Button> element now has
the attribute OnClick="Button1_Click". This attribute binds the button's Click event to
the handler method you coded in step 4.
Event handler methods can have any name; the name you see is the default name created
by Visual Web Developer. The important point is that the name used for the OnClick
attribute must match the name of a method in the page.
If you are using Visual Basic with code separation, Visual Web Developer does not add
an explicit OnClick attribute. Instead, the event is bound to the handler method using a
Handles keyword on the handler declaration itself.
2. Enter a name into the text box and click the button.
The name you entered is displayed in the Label control. Note that when you click the
button, the page is posted to the Web server. ASP.NET then recreates the page, runs your
code (in this case, the Button control's Click event handler runs), and then sends the new
page to the browser. If you watch the status bar in the browser, you can see that the page
is making a round trip to the Web server each time you click the button.
3. In the browser, view the source of the page you are running.
In the page source code, you see only ordinary HTML; you do not see the <asp:>
elements that you were working with in Source view. When the page runs, ASP.NET
processes the server controls and renders HTML elements to the page that perform the
functions that represent the control. For example, the <asp:Button> control is rendered as
the HTML element <input type="submit">.
In this part of the walkthrough, you will work with the Calendar control, which displays dates a
month at a time. The Calendar control is a more complex control than the button, text box, and
label you have been working with and illustrates some further capabilities of server controls.
In this section, you will add a Calendar control to the page and format it.
To add a Calendar control
The calendar's smart tag panel is displayed. The panel displays commands that make it
easy for you to perform the most common tasks for the selected control. The following
screen shot shows the Calendar control as rendered in Design view.
The Auto Format dialog box is displayed, which allows you to select a formatting scheme
for the calendar. The following screen shot shows the Auto Format dialog box for the
Calendar control.
You can see the <asp:Calendar> element. This element is much longer than the elements
for the simple controls you created earlier. It also includes subelements, such as
<WeekEndDayStyle>, which represent various formatting settings. The following screen
shot shows the Calendar control in Source view.
In this section, you will program the Calendar control to display the currently selected date.
2. Finish the SelectionChanged event handler with the following highlighted code.
VB
C#
protected void Calendar1_SelectionChanged(object sender,
System.EventArgs e)
{
Label1.Text = Calendar1.SelectedDate.ToLongDateString();
}
Note that the Calendar control has been rendered to the page as a table, with each day as
a <td> element containing an <a> element.
Practical2.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Practical2.aspx.vb"
Inherits="Practical3.Practical2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
Logo</td>
<td>
<asp:Image ID="Image1" runat="server" Height="100px"
ImageUrl="~/Chrysanthemum.jpg" Width="100px" />
</td>
<td>
</td>
</tr>
<tr>
<td>
Date of Birth</td>
<td>
<asp:Button ID="btnSubmit0" runat="server" Text="..." />
<asp:Calendar ID="Calendar1" runat="server"
Visible="False"></asp:Calendar>
<asp:Label ID="lblDate" runat="server"></asp:Label>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:HyperLink ID="lnkGoogle" runat="server"
NavigateUrl="http://www.google.com">Google</asp:HyperLink>
</td>
<td>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Practical2.aspx.vb
Public Class Practical2
Inherits System.Web.UI.Page
End Sub
BuiltInObjectsDemo.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="BuiltInObjectsDemo.aspx.vb"
Inherits="Practical2.BuiltInObjectsDemo" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
BuiltInObjectsDemo.aspx.vb
Public Class BuiltInObjectsDemo
Inherits System.Web.UI.Page
End Sub
End Class
SCREENSHOTS:
PRACTICAL: 4
AIM : Design a web form to allow user to enter following details in
his Resume using Web Server Controls. Set validations using
properties. When data is submitted it must be viewed in the panel
below the form. Fields of Resume are
Register.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Register.aspx.vb"
Inherits="A1BatchPract4.Register" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
height: 26px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table style="width:100%;">
<tr>
<td>
First Name</td>
<td>
<asp:TextBox ID="txtFirstName" runat="server"
MaxLength="20"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Last Name</td>
<td>
<asp:TextBox ID="txtLastName" runat="server"
MaxLength="20"></asp:TextBox>
</td>
<td>
Qualification</td>
<td>
<asp:TextBox ID="txtQualification" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Specialization Subject</td>
<td>
<asp:TextBox ID="txtSpecialization" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Percentage</td>
<td>
<asp:TextBox ID="txtPercentage" runat="server"
MaxLength="3"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnSubmit" runat="server" style="margin-bottom: 0px"
Text="Submit Resume Data" />
</td>
<td>
<input id="Reset1" type="reset" value="ReSeT" /></td>
</tr>
</table>
<asp:Panel ID="Panel1" runat="server" Visible="False">
<table style="width:100%;">
<tr>
<td>
First Name</td>
<td>
<asp:Label ID="lblFirstName" runat="server" Text="Label"></asp:Label>
</td>
<td>
</td>
</tr>
<tr>
<td>
Last Name</td>
<td>
<asp:Label ID="lblLastName" runat="server" Text="Label"></asp:Label>
</td>
<td>
</td>
</tr>
<tr>
Register.aspx.vb
Public Class Register
Inherits System.Web.UI.Page
End Sub
Panel1.Visible = True
End Sub
End Class
SCREENSHOTS:
Practical 5.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="practical 5.aspx.vb"
Inherits="Practical5.practical_5" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 156px;
}
.style2
{
width: 211px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td bgcolor="Silver" class="style2"
style="font-family: Arial, Helvetica, sans-serif; font-size: large;
font-weight: bold; font-style: inherit; font-variant: inherit; text-transform: inherit;
color: #0000FF;">
ASP.NET</td>
<td class="style1">
<asp:TextBox ID="txtasp" runat="server" BackColor="White"
BorderColor="#FF3300"
BorderStyle="Ridge" Font-Bold="False" Font-
Overline="False"></asp:TextBox>
</td>
<td>
<asp:Label ID="lblasp" runat="server" Text="Label"
ViewStateMode="Disabled"
Visible="False"></asp:Label>
</td>
</tr>
<tr>
<td bgcolor="Silver" class="style2"
style="font-family: Arial, Helvetica, sans-serif; font-size: large;
font-weight: bold; font-style: inherit; font-variant: inherit; text-transform: inherit;
color: #0000FF;">
JAVA</td>
<td class="style1">
<asp:TextBox ID="txtjava" runat="server" BackColor="White"
BorderColor="#FF3300" BorderStyle="Ridge" Font-Bold="False"
Font-Overline="False"></asp:TextBox>
</td>
<td>
<asp:Label ID="lbljava" runat="server" Text="Label"
ViewStateMode="Disabled"
Visible="False"></asp:Label>
</td>
</tr>
<tr>
<td bgcolor="Silver" class="style2"
style="font-family: Arial, Helvetica, sans-serif; font-size: large;
font-weight: bold; font-style: inherit; font-variant: inherit; text-transform: inherit;
color: #0000FF;">
EIS</td>
<td class="style1">
<asp:TextBox ID="txteis" runat="server" BackColor="White"
BorderColor="#FF3300"
BorderStyle="Ridge" Font-Bold="False" Font-
Overline="False"></asp:TextBox>
</td>
<td>
<asp:Label ID="lbleis" runat="server" Text="Label"
ViewStateMode="Disabled"
Visible="False"></asp:Label>
</td>
</tr>
<tr>
<td bgcolor="Silver" class="style2"
style="font-family: Arial, Helvetica, sans-serif; font-size: large;
font-weight: bold; font-style: inherit; font-variant: inherit; text-transform: inherit;
color: #0000FF;">
PROJECT</td>
<td class="style1">
<asp:TextBox ID="txtproject" runat="server" BackColor="White"
BorderColor="#FF3300" BorderStyle="Ridge" Font-Bold="False"
Font-Overline="False"></asp:TextBox>
</td>
<td>
<asp:Label ID="lblproject" runat="server" Text="Label"
ViewStateMode="Disabled"
Visible="False"></asp:Label>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style1">
<asp:Button ID="btngrade" runat="server" Text="Show My Grade" />
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Practical 5.aspx.vb
Public Class practical_5
Inherits System.Web.UI.Page
lblasp.Visible = True
lbljava.Visible = True
lbleis.Visible = True
lblproject.Visible = True
End Sub
End Class
SCREENSHOTS:
Start Date End/Sign Date Faculty Sign Remarks/Grade
PRACTICAL: 6
AIM : Create a Simple calculator with validations and details
pract 6.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="pract 6.aspx.vb"
Inherits="Practical6.pract_6" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
No 1 ::</td>
<td>
<asp:TextBox ID="txtno1" runat="server"></asp:TextBox>
</td>
<td>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="txtno1" ErrorMessage="Invalid Number"
ForeColor="Red"
MaximumValue="10000" MinimumValue="0"
Type="Integer"></asp:RangeValidator>
</td>
</tr>
<tr>
<td>
No 2 ::</td>
<td>
<asp:TextBox ID="txtno2" runat="server"></asp:TextBox>
</td>
<td>
<asp:RangeValidator ID="RangeValidator2" runat="server"
ControlToValidate="txtno2" ErrorMessage="Invalid Number"
ForeColor="Red"
MaximumValue="10000" MinimumValue="0"
Type="Integer"></asp:RangeValidator>
</td>
</tr>
<tr>
<td>
Operator ::</td>
<td>
<asp:DropDownList ID="drpOp" runat="server">
<asp:ListItem>+</asp:ListItem>
<asp:ListItem>-</asp:ListItem>
<asp:ListItem Value="*"></asp:ListItem>
<asp:ListItem>/</asp:ListItem>
</asp:DropDownList>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnclick" runat="server" Text="Find Answer"
Width="107px" />
</td>
<td>
</td>
</tr>
<tr>
<td>
Answer ::</td>
<td>
<asp:TextBox ID="txtans" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
pract 6.aspx.vb
Public Class pract_6
Inherits System.Web.UI.Page
Style.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Styles.aspx.vb"
Inherits="Practical7.Styles" %>
Style.aspx.vb
Public Class Styles
Inherits System.Web.UI.Page
End Sub
End Class
SCREENSHOTS:
ThemeDemo.aspx code
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="ThemeDemo.aspx.vb"
Inherits="Practical8ThemeSkin.ThemeDemo" Theme="Theme1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td align="center" colspan="3" style="font-size:
40px">
Theme 1</td>
</tr>
<tr>
<td>
<asp:Label ID="Label1" runat="server"
Text="Username" Font-Bold="true" ForeColor="Azure"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server"
Text="Password"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"
EnableTheming="false"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="Button1" runat="server"
Text="Login" />
</td>
<td>
<asp:Button ID="Button3" runat="server"
Text="Default Button"
EnableTheming="False" />
</td>
</tr>
<tr>
<td align="center" colspan="3" style="font-size:
40px">
Theme 2</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label3" runat="server"
Text="Username"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox3"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label4" runat="server"
Text="Password" EnableTheming="False"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox4" SkinID="second"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="Button2" runat="server"
Text="Login" />
</td>
<td>
<asp:Button ID="Button4" runat="server"
Text="Default Button" />
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
TextBox.Skin code
<asp:TextBox
ForeColor="Violet"
BackColor="Gray"
runat="server"
/>
<asp:TextBox
SkinId="second"
ForeColor="White"
BackColor="Blue"
runat="server"
/>
Label.Skin code
<asp:Label
runat="server"
Font-Bold="true"
ForeColor="Azure"
BackColor="Black"
/>
Button.Skin code
<asp:Button
runat="server"
BackColor="Teal"
ForeColor="White"
/>
ThemeDemo.aspx.vb code
Public Class ThemeDemo
Inherits System.Web.UI.Page
End Sub
End Class
Output screenshots:
MyMaster.master code
<%@ Master Language="VB" AutoEventWireup="false"
CodeBehind="MyMasterPage.master.vb"
Inherits="Practical9.MyMasterPage" %>
</div>
</form>
</body>
</html>
Sample.aspx.vb code
Public Class Sample
Inherits System.Web.UI.Page
End Sub
End Class
Output screenshots:
FacultyHome.aspx code
<%@ Page Title="" Language="vb" AutoEventWireup="false"
MasterPageFile="~/SideMenu.master" CodeBehind="FacultyHome.aspx.vb"
Inherits="Practical10.FacultyHome" %>
StudentHome.aspx code
<%@ Page Title="" Language="vb" AutoEventWireup="false"
MasterPageFile="~/TopMenus.Master" CodeBehind="StudentHome.aspx.vb"
Inherits="Practical10.StudentHome" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<p>
Welcome Student...</p>
</asp:Content>
SideMenu.master code
<%@ Master Language="VB" MasterPageFile="~/TopMenus.Master"
AutoEventWireup="false"
CodeBehind="SideMenu.master.vb" Inherits="Practical10.SideMenu" %>
TopMenu.master code
<%@ Master Language="VB" AutoEventWireup="false"
CodeBehind="TopMenus.master.vb" Inherits="Practical10.TopMenus" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="http://www.google.com">Change
Password</asp:HyperLink>
</td>
<td>
<asp:HyperLink ID="HyperLink2" runat="server"
NavigateUrl="http://www.google.com">View
Result</asp:HyperLink>
</td>
<td>
<asp:HyperLink ID="HyperLink3" runat="server"
NavigateUrl="http://www.google.com">Log
Out</asp:HyperLink>
</td>
</tr>
</table>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1"
runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Output screenshots:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
Username</td>
<td>
<asp:TextBox ID="txtUserName"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Password</td>
<td>
<asp:TextBox ID="txtPassword" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:CheckBox ID="chkRemember" runat="server"
Text="Remember Me" />
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnLogin" runat="server"
Text="Login" />
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Login.aspx.vb code
Public Class Login
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Try
If Page.IsPostBack = False Then
txtUserName.Text =
Request.Cookies("myFirstCookie").Values("username")
End If
Catch ex As Exception
txtUserName.Text = ""
End Try
End Sub
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles btnLogin.Click
If chkRemember.Checked = True Then
Dim c As New HttpCookie("myFirstCookie")
c.Expires = Now.AddMinutes(1)
c.Values("username") = txtUserName.Text
Response.Cookies.Add(c)
End If
End Sub
End Class
Output screenshots:
First run:
Running page again gives username from cookie:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
User Id</td>
<td>
<asp:TextBox ID="txtUsername"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Passcode</td>
<td>
<asp:TextBox ID="txtPassword" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnLogin" runat="server"
Text="Login" />
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Home.aspx code
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="Home.aspx.vb"
Inherits="Practical12ApplicationSession.Home" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Login.aspx.vb code
Public Class Login
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
End Sub
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles btnLogin.Click
Session.Item("username") = txtUsername.Text
Application.Item("username") = txtUsername.Text
Response.Redirect("Home.aspx")
End Sub
End Class
Home.aspx.vb code
Public Class Home
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Response.Write("Welcome : " & Session.Item("username"))
Response.Write("<br/>Last logged in user : " &
Application.Item("username"))
End Sub
End Class
Output screenshots:
First look at output by first user
First user logging in
ListOfTopic.aspx code:
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="ListOfTopics.aspx.vb"
Inherits="Practical13ViewstateQueryString.ListOfTopics" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body bgcolor="#99AAFF">
<form id="form1" runat="server">
<div>
<table width="80%" align="center" style="background-
color:white">
<tr>
<td><a href="Tutorial.aspx?chap=1">Chapter-1</a></td>
<td><a href="Tutorial.aspx?chap=2">Chapter-2</a></td>
</tr>
</table>
</div>
<table style="width:100%;">
<tr>
<td>
<asp:Label ID="Label1" runat="server"
Text="no1"></asp:Label>
</td>
<td>
<asp:TextBox ID="Textno1"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2">
<center> <asp:Button ID="Button1" runat="server"
Text="store" />
<asp:Button ID="Button2" runat="server"
Text="transfer" /></center>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server"
Text="no2"></asp:Label>
</td>
<td>
<asp:TextBox ID="Textno2"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
</table>
</form>
</body>
</html>
ListOfTopic.aspx .vbcode:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles Button1.Click
ViewState("no") = Textno1.Text
End Sub
OnlineVisitorCntPage.aspx code:
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="OnlineVisitorCntPage.aspx.vb"
Inherits="GlobalPract.OnlineVisitorCntPage" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Global.asax code:
Imports System.Web.SessionState
Public Class Global_asax
Inherits System.Web.HttpApplication
Sub Application_Start(ByVal sender As Object, ByVal e As
EventArgs)
' Fires when the application is started
Application.Item("vCnt") = 0
Application.Item("oCnt") = 0
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
Application.Item("vCnt") =
Convert.ToInt16(Application.Item("vCnt")) + 1
Application.Item("oCnt") =
Convert.ToInt16(Application.Item("oCnt")) + 1
End Sub
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:Button ID="Button1" runat="server" Text="Test Stupid URL!!!"
/>
</form>
</body>
</html>
SampleConfiguration.aspx.vb code:
Public Class SampleConfiguration
Inherits System.Web.UI.Page
End Sub
Web.config code:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application,
please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true"
targetFramework="4.0" />
<customErrors mode="On" defaultRedirect="error.html"
redirectMode="ResponseRedirect">
<error statusCode="404" redirect="error.html"/>
</customErrors>
</system.web>
<connectionStrings >
<add name="myConStr"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\Darshak\Documents\HariOm.accdb"/>
</connectionStrings>
<appSettings>
<add key="version" value="1.0" />
</appSettings>
</configuration>
Output screenshots:
Start Date End/Sign Date Faculty Sign Remarks/Grade
PRACTICAL: 16
AIM: Write sample application to connect to database (connection
object), Fetching and inserting data from database (command object)
and using Data Reader
Inside Database:
DataPage.aspx code:
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="DataPage.aspx.vb"
Inherits="Practical16DbConnReadDML.DataPage" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnFetch" runat="server" Text="Fetch Data
using DataReader" />
<asp:Button ID="btnInsert" runat="server" Text="Insert Data" />
</div>
</form>
</body>
</html>
DataPage.aspx.vb code:
Imports System.Data.OleDb
End Sub
Output screenshots:
First run:
On clicking fetch button:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
Student Name:</td>
<td>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnCheck" runat="server"
Text="Check Name" />
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Home.aspx code
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="Home.aspx.vb" Inherits="Practical17.Home" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Welcome home...</div>
</form>
</body>
</html>
Login.aspx.vb code
Imports System.Data.OleDb
End Sub
Home.aspx.vb code
Public Class Home
Inherits System.Web.UI.Page
End Sub
End Class
Output screenshots:
Start Date End/Sign Date Faculty Sign Remarks/Grade
PRACTICAL: 18
AIM: Create a Web page and test the connectivity of your database with
biodata form in exercise 1. If connected, display the message that
connection with database is successful, and redirect the user to his
homepage
Inside Database:
Login.aspx code
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="Login.aspx.vb" Inherits="Practical17.Login" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
Student Name:</td>
<td>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
student password</td>
<td>
<asp:TextBox ID="txtpassword" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
</table>
</div>
<p>
<asp:Button ID="btnCheck" runat="server" Text="Log
In" />
</p>
</form>
</body>
</html>
Home.aspx code
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="Home.aspx.vb" Inherits="Practical17.Home" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Welcome home...</div>
</form>
</body>
</html>
Login.aspx.vb code
Imports System.Data.OleDb
End Sub
Home.aspx.vb code
Public Class Home
Inherits System.Web.UI.Page
Output screenshots:
Start Date End/Sign Date Faculty Sign Remarks/Grade
PRACTICAL: 19
AIM : Create a web page to insert user biodata information with all
validations in to the database
Biodata.aspx
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="BioData.aspx.vb" Inherits="Practical19.BioData" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
First Name</td>
<td>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1"
ErrorMessage="Enter First Name"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Last Name</td>
<td>
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ControlToValidate="TextBox2"
ErrorMessage="Enter Last Name"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Birthdate</td>
<td>
<asp:TextBox ID="TextBox3"
runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ControlToValidate="TextBox3"
ErrorMessage="Enter Birthdate"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Hometown</td>
<td>
<asp:TextBox ID="TextBox4"
runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server"
ControlToValidate="TextBox4"
ErrorMessage="Enter Hometown"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Marital Status</td>
<td>
<asp:RadioButton ID="rdoNeverMarried"
runat="server" Checked="True"
GroupName="maritalStatus" Text="Never Married"
/>
<asp:RadioButton ID="rdoMarried" runat="server"
GroupName="maritalStatus"
Text="Married" />
<asp:RadioButton ID="rdoDivorced" runat="server"
GroupName="maritalStatus"
Text="Divorced" />
<asp:RadioButton ID="rdoWidow" runat="server"
GroupName="maritalStatus"
Text="Widow" />
</td>
<td>
</td>
</tr>
<tr>
<td>
Age</td>
<td>
<asp:TextBox ID="TextBox5"
runat="server"></asp:TextBox>
</td>
<td>
<asp:RangeValidator ID="RangeValidator1"
runat="server"
ControlToValidate="TextBox5"
ErrorMessage="Invalid Age" ForeColor="Red"
MaximumValue="100" MinimumValue="0"
Type="Integer"></asp:RangeValidator>
</td>
</tr>
<tr>
<td>
Hobby</td>
<td>
<asp:TextBox ID="TextBox6"
runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator6" runat="server"
ControlToValidate="TextBox6"
ErrorMessage="Enter Hobby"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Current City</td>
<td>
<asp:TextBox ID="TextBox7"
runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator7" runat="server"
ControlToValidate="TextBox7"
ErrorMessage="Enter Current City"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnSave" runat="server" Text="Save
Data" />
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Biodata.aspx.vb
Imports System.Data.OleDb
End Sub
Login.aspx
Imports System.Data.SqlClient
End Sub
Login.aspx.vb
Imports System.Data.SqlClient
End Sub
Register.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Register.aspx.vb"
Inherits="Practical20.Register" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
Username</td>
<td>
<asp:TextBox ID="txtUsrNm" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Password</td>
<td>
<asp:TextBox ID="txtUsrPw" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Confirm Password</td>
<td>
Page #: 101 | Government Polytechnic, Gandhinagar
</div>
</form>
</body>
</html>
Register.aspx.vb
Imports System.Data.SqlClient
End Sub
ForgotPwd.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ForgotPwd.aspx.vb"
Inherits="Practical20.ForgotPwd" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
Enter Username</td>
<td>
<asp:TextBox ID="txtUsrNm" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnShowHint" runat="server" Text="Show Hint" />
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblHint" runat="server" Font-Bold="True"
ForeColor="#009933"></asp:Label>
</td>
<td colspan="2">
<asp:LinkButton ID="lnkLogin" runat="server"
PostBackUrl="~/Login.aspx">Back to Login</asp:LinkButton>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
ForgotPwd.aspx.vb
Imports System.Data.SqlClient
End Sub
Home.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Home.aspx.vb"
Inherits="Practical20.Home" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Welcome Home...</div>
</form>
</body>
</html>
Home.aspx.vb
Public Class Home
Inherits System.Web.UI.Page
End Sub
End Class
SCREENSHOTS:
Start Date End/Sign Date Faculty Sign Remarks/Grade
PRACTICAL: 21
AIM : Create a webpage to display the information about user on his
homepage once he has logged in through the login form
Login.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Login.aspx.vb"
Inherits="Practical21.Login" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
Username</td>
<td>
<asp:TextBox ID="txtUsrNm" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Password</td>
<td>
<asp:TextBox ID="txtUsrPw" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnLogin" runat="server" Text="Login" />
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Login.aspx.vb
Imports System.Data.SqlClient
End Sub
Home.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Home.aspx.vb"
Inherits="Practical21.Home" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
<asp:Label ID="lblUserName" runat="server"></asp:Label>
</td>
<td>
</td>
<td>
<asp:LinkButton ID="lnkLogOut" runat="server">Log
Out</asp:LinkButton>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDesignation" runat="server"></asp:Label>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Home.aspx.vb
Imports System.Data.SqlClient
SCREENSHOTS:
Start Date End/Sign Date Faculty Sign Remarks/Grade
PRACTICAL: 22
AIM : Write an exercise, to allow the user to ADD, UPDATE, MODIFY his profile once
he has logged into the website using Bound and Unbound Controls
Home.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Home.aspx.vb"
Inherits="Practical22.Home" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Home.aspx.vb
Public Class Home
Inherits System.Web.UI.Page
End Sub
End Class
Bound.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Bound.aspx.vb"
Inherits="Practical22.Bound" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True"
AutoGenerateRows="False" DataKeyNames="UsrNm"
DataSourceID="SqlDataSource1"
Height="50px" Width="125px">
<Fields>
<asp:BoundField DataField="UsrNm" HeaderText="UsrNm"
ReadOnly="True"
SortExpression="UsrNm" />
<asp:BoundField DataField="UsrPw" HeaderText="UsrPw"
SortExpression="UsrPw" />
<asp:BoundField DataField="Hint" HeaderText="Hint"
SortExpression="Hint" />
<asp:BoundField DataField="Designation"
HeaderText="Designation"
SortExpression="Designation" />
<asp:CommandField ShowEditButton="True"
ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [tblLogin] WHERE [UsrNm] =
@original_UsrNm AND (([UsrPw] = @original_UsrPw) OR ([UsrPw] IS NULL AND @original_UsrPw
IS NULL)) AND (([Hint] = @original_Hint) OR ([Hint] IS NULL AND @original_Hint IS NULL))
AND (([Designation] = @original_Designation) OR ([Designation] IS NULL AND
@original_Designation IS NULL))"
InsertCommand="INSERT INTO [tblLogin] ([UsrNm], [UsrPw], [Hint],
[Designation]) VALUES (@UsrNm, @UsrPw, @Hint, @Designation)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT * FROM [tblLogin]"
UpdateCommand="UPDATE [tblLogin] SET [UsrPw] = @UsrPw, [Hint] =
@Hint, [Designation] = @Designation WHERE [UsrNm] = @original_UsrNm AND (([UsrPw] =
@original_UsrPw) OR ([UsrPw] IS NULL AND @original_UsrPw IS NULL)) AND (([Hint] =
@original_Hint) OR ([Hint] IS NULL AND @original_Hint IS NULL)) AND (([Designation] =
@original_Designation) OR ([Designation] IS NULL AND @original_Designation IS NULL))">
<DeleteParameters>
<asp:Parameter Name="original_UsrNm" Type="String" />
<asp:Parameter Name="original_UsrPw" Type="String" />
<asp:Parameter Name="original_Hint" Type="String" />
<asp:Parameter Name="original_Designation" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="UsrNm" Type="String" />
<asp:Parameter Name="UsrPw" Type="String" />
<asp:Parameter Name="Hint" Type="String" />
<asp:Parameter Name="Designation" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="UsrPw" Type="String" />
<asp:Parameter Name="Hint" Type="String" />
<asp:Parameter Name="Designation" Type="String" />
<asp:Parameter Name="original_UsrNm" Type="String" />
<asp:Parameter Name="original_UsrPw" Type="String" />
<asp:Parameter Name="original_Hint" Type="String" />
<asp:Parameter Name="original_Designation" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Bound.aspx.vb
Public Class Bound
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
End Sub
End Class
Unbound.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="UnBound.aspx.vb"
Inherits="Practical22.UnBound" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
<asp:RadioButton ID="rdoAdd" runat="server" AutoPostBack="True"
GroupName="operation" Text="Add Data" />
</td>
<td>
<asp:RadioButton ID="rdoUpdate" runat="server" AutoPostBack="True"
GroupName="operation" Text="Update Data" />
</td>
<td>
</td>
</tr>
<tr>
<td>
<asp:Panel ID="pnlAdd" runat="server" Visible="False">
<table style="width:100%;">
<tr>
<td>
Name</td>
<td>
<asp:TextBox ID="txtInsName"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Designation</td>
<td>
<asp:TextBox ID="txtInsDesignation"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Password</td>
<td>
<asp:TextBox ID="txtInsPwd" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Confirm Password</td>
<td>
<asp:TextBox ID="txtInsCnfPwd" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Hint</td>
<td>
<asp:TextBox ID="txtInsHint"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnAdd" runat="server" Text="Add" />
</td>
<td>
</td>
</tr>
</table>
</asp:Panel>
</td>
<td>
<asp:Panel ID="pnlUpdate" runat="server" Visible="False">
<table style="width:100%;">
<tr>
<td>
Name</td>
<td>
<asp:DropDownList ID="drpFName" runat="server"
AutoPostBack="True">
</asp:DropDownList>
</td>
<td>
</td>
</tr>
<tr>
<td>
Designation</td>
<td>
<asp:TextBox ID="txtUpdDesignation"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Password</td>
<td>
<asp:TextBox ID="txtUpdPwd" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Confirm Password</td>
<td>
<asp:TextBox ID="txtUpdCnfPwd" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Hint</td>
<td>
<asp:TextBox ID="txtUpdHint"
runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnUpdate" runat="server"
Text="Update" />
</td>
<td>
</td>
</tr>
</table>
</asp:Panel>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Unbound.aspx.vb
Imports System.Data.SqlClient
GridViewDynamic.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="GridViewDynamic.aspx.vb"
Inherits="Practical23.GridViewDynamic" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width:100%;">
<tr>
<td>
Select Criteria:</td>
<td>
<asp:RadioButton ID="rdoFull" runat="server" AutoPostBack="True"
GroupName="criteria" Text="Full Data" />
</td>
<td>
<asp:RadioButton ID="rdoLimited" runat="server" AutoPostBack="True"
GroupName="criteria" Text="Limited Data(Hide Password)" />
</td>
</tr>
<tr>
<td align="center" colspan="3">
<asp:GridView ID="GridView1" runat="server" CellPadding="4"
ForeColor="#333333"
GridLines="None">
<AlternatingRowStyle BackColor="White" />
<EditRowStyle BackColor="#7C6F57" />
<FooterStyle BackColor="#1C5E55" Font-Bold="True"
ForeColor="White" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True"
ForeColor="White" />
<PagerStyle BackColor="#666666" ForeColor="White"
HorizontalAlign="Center" />
<RowStyle BackColor="#E3EAEB" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True"
ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F8FAFA" />
<SortedAscendingHeaderStyle BackColor="#246B61" />
<SortedDescendingCellStyle BackColor="#D4DFE1" />
<SortedDescendingHeaderStyle BackColor="#15524A" />
</asp:GridView>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
GridViewDynamic.aspx.vb
Imports System.Data.SqlClient
End Sub
SCREENSHOTS:
Start Date End/Sign Date Faculty Sign Remarks/Grade
Page #: 1 | Government Polytechnic, Gandhinagar
ASP.Net Assignments
•Assignment 1
Question : 1
Login.aspx:
function processAjaxData() {
this.history.pushState({"html" : "<html><head></head><body>Ram
Ram</body></html>" ,"Darshak")},"","http://localhost:50466/Login.aspx");
/*document.getElementById("content").innerHTML = response.html ;
document.title = response.pageTitle;
window.history.pushState({ "html": response.html, "pageTitle":
response.pageTitle }, "", "http://www.gmail.com");
*/
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 700px; width: 1345px; margin: -8px;">
<center>
<font size="6"><font color="#3388FF">G</font><font
color="#ee0000">o</font><font
color="yellow">o</font><font color="#3388FF">g</font><font
color="green">l</font><font
color="#ee0000">e</font> </font>
<br />
<br />
<font face="corbel" size="6" color="#666666">One Account. All of
Google.</font><br />
<br />
<br />
<font face="corbel" size="4" color="#656565">Sign in to Continue to
Gmail</font>
<div style="height: 350px; width: 330px; border: none; margin-top: 8px; border-radius: 5px;
box-shadow: 0px 2px 2px lightgray; background-color: #F7F7F7">
</div>
</div>
<div style="height: 100px; width: 500px; border: none; margin-top: 15px;">
<font face="corbel" size="3" color="#3399ff">create an account</font><br
/>
<br />
<br />
<font face="corbel" size="3" color="#656565">One Google Account for
everything Google</font>
<img src="Services.PNG" alt="services" />
</div>
</center>
</div>
</form>
</body>
</html>
Output Screen:-
Question : 2
Login.aspx:
Question : 3
AIM : Design a Webpage with a master Page having menues and submenues
Site.Master:
</div>
</form>
</body>
</html>
Default.aspx:
<div style="height:540px;width:500px;border:solid;margin-top:50px;margin-left:200px;">
<table style="width:100%;">
<tr><td>
EnrollmentNo</td><td>
<asp:TextBox ID="txtEnrno" runat="server" TabIndex="1"
Wrap="False"></asp:TextBox>
</td><td>
</td>
</tr>
<tr> <td>
Password</td>
<td style="margin-left: 40px">
<asp:TextBox ID="txtPwd" runat="server" TabIndex="2"
TextMode="Password"></asp:TextBox>
</td> <td>
</td>
</tr>
<tr>
<td>
Confirm Password</td <td>
<asp:TextBox ID="txtCnfpwd" runat="server" TabIndex="3"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Address</td>
<td>
<asp:TextBox ID="txtAdd" runat="server" TabIndex="4"
TextMode="MultiLine"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
MobileNo</td>
<td>
<asp:TextBox ID="txtMob" runat="server" TabIndex="6"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Email</td>
<td>
<asp:TextBox ID="txtEmail" runat="server" TabIndex="7"
TextMode="Email"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Gender</td>
<td>
<asp:RadioButton ID="rdoMale" runat="server" GroupName="Gender"
TabIndex="8"
Text="Male" />
<asp:RadioButton ID="rdoFemale" runat="server" GroupName="Gender"
TabIndex="8"
Text="Female" />
</td>
<td>
</td>
</tr>
<tr>
<td>
City</td>
<td>
<asp:DropDownList ID="drpCity" runat="server" TabIndex="9">
</asp:DropDownList>
</td>
<td>
</td>
</tr>
<tr>
<td>
State</td>
<td>
<asp:ListBox ID="lstState" runat="server"
TabIndex="10"></asp:ListBox>
</td>
<td>
</td>
</tr>
<tr><td>
</td>
<td>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
<input id="Reset1" type="reset" value="Reset" /></td>
<td>
</td>
</tr>
</table>
</div>
</asp:Content>
Output Screen:-
Question : 4
AIM : Design a Webpage with a master Page have nested masterpage within it.
Site.Master:
</div>
</form>
</body>
</html>
nest.Master:
Default.aspx:
Registration.aspx:
<table style="width:100%;">
<tr><td>
EnrollmentNo</td><td>
<asp:TextBox ID="txtEnrno" runat="server" TabIndex="1"
Wrap="False"></asp:TextBox>
</td><td>
</td>
</tr>
<tr> <td>
Password</td>
<td style="margin-left: 40px">
<asp:TextBox ID="txtPwd" runat="server" TabIndex="2"
TextMode="Password"></asp:TextBox>
</td> <td>
</td>
</tr>
<tr>
<td>
Confirm Password</td <td>
<asp:TextBox ID="txtCnfpwd" runat="server" TabIndex="3"
TextMode="Password"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Address</td>
<td>
<asp:TextBox ID="txtAdd" runat="server" TabIndex="4"
TextMode="MultiLine"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
MobileNo</td>
<td>
<asp:TextBox ID="txtMob" runat="server" TabIndex="6"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Email</td>
<td>
<asp:TextBox ID="txtEmail" runat="server" TabIndex="7" TextMode="Email"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td>
Gender</td>
<td>
<asp:RadioButton ID="rdoMale" runat="server" GroupName="Gender"
TabIndex="8"
Text="Male" />
<asp:RadioButton ID="rdoFemale" runat="server" GroupName="Gender"
TabIndex="8"
Text="Female" />
</td>
<td>
</td>
</tr>
<tr>
<td>
City</td>
<td>
<asp:DropDownList ID="drpCity" runat="server" TabIndex="9">
</asp:DropDownList>
</td>
<td>
</td>
</tr>
<tr>
<td>
State</td>
<td>
<asp:ListBox ID="lstState" runat="server" TabIndex="10"></asp:ListBox>
</td>
<td>
</td>
</tr>
<tr><td>
</td>
<td>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
<input id="Reset1" type="reset" value="Reset" /></td>
<td>
</td>
</tr>
</table>
</div>
</asp:Content>
Output Screen:-
Question : 5
AIM : Design a Simple Login page where UserId from these page is passed to
Home page with a Welcome message and UserId.
Login.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<center>
<div>
<div style="height:230px;width:300px;border-radius:10px;margin-top:185px;box-
shadow:1px 1px 1px 1px #454545;">
<table cellpadding="5">
<tr>
<td colspan="2" align="center">
<font size="6" face="Comic sans MS" color="#454545">Log
in</font></td>
</tr>
<tr>
<td>
<font size="4">Username</font></td>
<td>
<asp:TextBox ID="txtUser" runat="server" Height="35px" Width="200px" Font-Size="20px" ForeColor="#454545"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<font size="4">Password</font></td>
<td>
<asp:TextBox ID="txtPwd" runat="server" Height="35px" Width="200px" Font-Size="20px" ForeColor="#454545"
TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnLogin" runat="server" BackColor="#4B8BF5"
BorderStyle="Solid"
Font-Bold="True" Font-Italic="False" Font-Names="Calibri" Font-
Size="Medium"
ForeColor="White" Height="35px" Text="Login" Width="262px"
BorderColor="#4B8BF5" BorderWidth="1px" />
</td>
</tr>
</table>
</div>
</div>
</center>
</form>
</body>
</html>
Login.aspx:
<html xmlns="">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Login.aspx.vb :
End Sub
Session.Item("Username") = txtUser.Text
Response.Redirect("Destination.aspx")
End Sub
End Class
Destination.aspx.vb :
End Class
Output Screen:-
Question : 6
AIM : Write a Application where all State management options are used with
fairly appropriate example.
Login.aspx:
Destination.aspx:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Destination.aspx.vb"
Inherits="Question6.Destination" %>
Test.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="50%" align="center">
<tr>
<td>Test Started On:</td>
<td>
<asp:Label ID="lblStart" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>Time Spent till Last Question :</td>
<td>
<asp:Label ID="lblDuration" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2"><asp:Label ID="lblQuestion" runat="server"
Text="Question-1"></asp:Label></td>
</tr>
<tr>
<td align="right" colspan="2"><asp:Button ID="btnNext" runat="server"
Text="Next" /></td>
</tr>
<tr>
<td align="center" colspan="2"><asp:LinkButton ID="lnkHome"
runat="server"
Text="Home"
PostBackUrl="~/Destination.aspx"></asp:LinkButton></td>
</tr>
</table>
</div>
</form>
</body>
</html>
Login.aspx.vb :
Try
txtUser.Text = Request.Cookies("myCookie").Values("Username")
Catch ex As Exception
End Try
bel1.Visible = False
nerateCaptcha() End If
d Sub
= r.Next(0, 10) n &= r.Next(0, 10) n &= r.Next(0, 10) n &= r.Next(0, 10)
Image1.ImageUrl = "~/Images/" & n.Substring(0, 1) & ".png"
Image2.ImageUrl = "~/Images/" & n.Substring(1, 1) & ".png"
Image3.ImageUrl = "~/Images/" & n.Substring(2, 1) & ".png"
Image4.ImageUrl = "~/Images/" & n.Substring(3, 1) & ".png"
HiddenField1.Value = n
End Sub
End Class
Destination.aspx.vb :
End Sub
Protected Sub lnkTest_Click(ByVal sender As Object, ByVal e As EventArgs) Handles
lnkTest.Click
response.redirect("Test.aspx")
End Sub
End Sub
End Sub
End Class
Err.htm :
Output Screen:-
Question : 7
AIM : Design a page and use Regular Expression for Particular Requirements
and show invalid data & Error message
1. Student name must start with “S” letter and followed by 5 digit.
3. C-Language Identifier
Velocity.aspx:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Velocity.aspx.vb"
Inherits="Question7.Velocity" %>
Output Screen:-
Start Date End/Sign Date Faculty Sign Remarks/Grade
Page #: 37 | Government Polytechnic, Gandhinagar
ASP.Net Assignments
•Assignment 2
Question : 1
AIM : Write a Application for Online User & Total visitor count.
Login.aspx:
Display.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<center> <asp:Label ID="lblUser" runat="server" Font-Bold="True" Font-Names="Comic
sans MS"
Font-Size="Larger" ForeColor="#663300" ></asp:Label>
<br /><br /> <asp:Label ID="lblVisitor" runat="server" Font-Bold="True" Font-
Names="Comic sans MS"
Font-Size="Larger" ForeColor="#663300" ></asp:Label>
<br />
<asp:Label ID="lblOnline" runat="server" Font-Bold="True" Font-Names="Comic sans
MS"
Font-Size="Larger" ForeColor="#00FF00" ></asp:Label>
</center>
</div>
</form>
</body>
</html>
Code for Program:
Login.aspx.vb :
Display.aspx.vb :
End Class
Global.asax.vb :
Imports System.Web.SessionState
Output Screen:-
Question : 2
Login.aspx:
Display.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div><center><asp:Label ID="lblUser" runat="server" Font-Bold="True" Font-
Names="Comic sans MS"
Font-Size="Larger" ForeColor="#663300" ></asp:Label>
<br /><br />Please visit ur G-mail Account...
</center>
</div>
</form>
</body>
</html>
Login.aspx.vb :
Imports System.Net
Imports System.Net.Mail
End Sub
End Try
End Sub
End Class
Display.aspx.vb :
Public Class display
Inherits System.Web.UI.Page
dbprocess.vb :
Imports System.Data.SqlClient
Imports System.Security.Cryptography
Imports System.Net
Imports System.Net.Mail
AIM : Write application which denies access to a websites when Online user
exceed 2 counts.
Index.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>Welcome...</h1>
</div>
</form>
</body>
</html>
Overload.htm:
Index.aspx.vb :
End Class
Global.asax.vb :
Imports System.Web.SessionState
End Class
Output Screen:-
1st User…
2nd User…
3rd User…
Question : 4
AIM : Write a page which allow to perform insert, update, and delete queries
where result in table data is displayed in a data grid.
View.aspx:
View.aspx.vb :
Imports System.Data.SqlClient
Public Class View
Inherits System.Web.UI.Page
End Sub
txtCity.Visible = False
txtDesignation.Visible = False
txtEmpName.Visible = False
lblCity.Visible = False
lblDesignation.Visible = False
lblEmployeeName.Visible = False
btnInsert.Visible = False
Response.Redirect("view.aspx")
End Sub
Protected Sub lnkUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles
lnkUpdate.Click
txtEmpID.Visible = True
lblEmpID.Visible = True
lnkDelete.Visible = False
lnkInsert.Visible = False
lnkUpdate.Visible = False
btnUpdate.Visible = True
btnUpdate.Text = "Select"
End Sub
Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles
btnUpdate.Click
If btnUpdate.Text = "Select" Then
txtEmpID.Enabled = False
txtCity.Visible = True
txtDesignation.Visible = True
txtEmpName.Visible = True
lblCity.Visible = True
lblDesignation.Visible = True
lblEmployeeName.Visible = True
If Page.IsPostBack Then
Dim obj As New dbProcess
Dim ds As New DataSet
ds = obj.fetch("Select * from Employee where EmpID = " & txtEmpID.Text)
txtEmpName.Text = ds.Tables(0).Rows(0).Item("EName")
txtDesignation.Text = ds.Tables(0).Rows(0).Item("Designation")
txtCity.Text = ds.Tables(0).Rows(0).Item("City")
btnUpdate.Visible = True
btnUpdate.Text = "Update"
End If
Else
Dim obj As New dbProcess
obj.DML("Update Employee set EName='" & txtEmpName.Text & "',Designation='" &
txtDesignation.Text & "',City='" & txtCity.Text & "' where EmpID='" & txtEmpID.Text &
"'")
Response.Redirect("view.aspx")
End If
End Sub
Protected Sub lnkDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles
lnkDelete.Click
lblEmpID.Visible = True
txtEmpID.Visible = True
lnkUpdate.Visible = False
lnkInsert.Visible = False
btnDelete.Visible = True
btnDelete.Text = "Select"
End Sub
End Sub
End Class
dbprocess.vb :
Imports System.Data.SqlClient
con.Open()
ad.Fill(ds)
con.Close()
Return ds
End Function
Sub DML(ByVal str As String)
Dim con As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|
DataDirectory|\databank.mdf;Integrated Security=True;User Instance=True")
Dim cmd As New SqlCommand(str, con)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
End Sub
End Class
Output Screen:-
Question : 5
AIM : Design and write a code for a page which sort and filters data using data
view and display content in grid view.
Login.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Display.aspx.vb :
Imports System.Data.SqlClient
con.Open()
ad.Fill(ds)
con.Close()
For i = 0 To ds.Tables(0).Columns.Count - 1
drpOrdering.Items.Add(ds.Tables(0).Columns(i).ColumnName)
drpWhereCondition.Items.Add(ds.Tables(0).Columns(i).ColumnName)
Next
End If
End Sub
con.Open()
ad.Fill(ds)
con.Close()
dv.RowFilter = drpWhereCondition.Text & " " & DropDownList3.Text & " '" &
txtCriteria.Text & "'"
If rdoAscending.Checked = True Then
dv.Sort = drpOrdering.Text
Else
dv.Sort = drpOrdering.Text & " DESC"
End If
GridView1.DataSource = dv
GridView1.DataBind()
End Sub
End Class
Output Screen:-