Jawaharlal Nehru Engineering College: Laboratory Manual
Jawaharlal Nehru Engineering College: Laboratory Manual
Jawaharlal Nehru Engineering College: Laboratory Manual
Laboratory Manual
(ASP.NET)
For
As you may be aware that MGM has already been awarded with ISO 9000
certification and it is our endure to technically equipt our students taking the
advantage of the procedural aspects of ISO 9000 Certification.
Faculty members are also advised that covering these aspects in initial stage
itself, will greatly relived them in future as much of the load will be taken care
by the enthusiasm energies of the students once they are conceptually clear.
Prof. S.D.DESHMUKH
Principal
LABORATORY MANUAL CONTENTS
This manual is intended for the students S.Y (M.C.A) engineering for the
subject of ASP.NET. Subject name itself is expecting what are the advance
controls and services that might be used to develop web applications using
Microsoft technology i.e. ASP.NET with code behind language c#.
In the subject of this manual typically contains practical/Lab Sessions we
have dealt with ASP.NET.
ASP.NET is the next generation ASP, but it's not an upgraded version of ASP.
ASP.NET is an entirely new technology for server-side scripting. It was
written from the ground up and is not backward compatible with classic ASP.
Students are advised to thoroughly go through this manual rather than only
topics mentioned are the key to understanding and conceptual visualization of
theoretical aspects covered in the books.
Lect. K. K. Misal
SUBJECT INDEX:
2. Read carefully the power ratings of the equipment before it is switched on whether ratings
230 V/50
Hz or 115V/60 Hz. For Indian equipments, the power ratings are normally 230V/50Hz. If you
have equipment with 115/60 Hz ratings, do not insert power plug, as our normal supply is
230V/50 Hz, which will damage the equipment.
1. Submission related to whatever lab work has been completed should be done during the next lab
session. The immediate arrangements for printouts related to submission on the day of practical
assignments.
2. Students should be taught for taking the printouts under the observation of lab teacher.
3. The promptness of submission should be encouraged by way of marking and evaluation patterns
that will benefit the sincere students.
WARMUP EXCERCISES:
.NET Framework, namespaces, page life cycle, HTML and web controls.
Validation controls.
[Purpose of this exercise is to introduce c#. You can use Visual Studio .NET
environment to type the program. Execution of program in two ways.
1. Press F5 button OR
1. Write a program in VISUAL STUDIO.NET environment.
2. If VISUAL STUDIO .NET environment then
(i) Right click on Solution Explorer and Select Add New Item.
(ii) Select Console Application.
(iii) Write the code.
(iv) Select page in Solution Explorer =>Right click=>Select View in
Browser to execute.
OR
Press F5 button for execution.
Exercise No1: ( 2 Hours) – 1 Practical
[Purpose of this exercise is to introduce c#. You can use Visual Studio
.NET environment to type the program. Execution of program in two ways.
2. Press F5 button OR
3. Right click on ASP.NET page (for e.g.: Default.aspx) and Select “View
Browser” option and select any browser for execution.
Steps:
1. Start a new web site with two web forms. Let Default.aspx and Success.aspx are
two web forms.
2. Design Default.aspx page with fields Employee name, address, contact no, email
id and a submit button.
3. After filling all information, it should be displayed on Success.aspx page using
Query String or Session state management technique.
4. Code using Query String as shown below:
4. Lab Exercises:
[Purpose of this exercise is to use advance web controls. You can use Visual Studio
.NET environment to type the program. Execution of program in two ways.
1. Press F5 button OR
2. Right click on ASP.NET page (for eg: Default.aspx) and Select “View Browser”
option and select any browser for execution.
Steps:
1. Start a new web site with two web forms. Let Default.aspx and Default2.aspx
are two web forms.
2. Take Hyperlink, Linkbutton and Fileupload controls from toolbox.
3. Follow the code:
( Default.aspx)
5. Lab Exercises:
[Purpose of this exercise is to ASP.NET master pages allow you to create a consistent
layout for the pages in your application. A single master page defines the look and
feel and standard behavior that you want for all of the pages (or a group of pages) in
your application. You can then create individual content pages that contain the
content you want to display. When users request the content pages, they merge with
the master page to produce output that combines the layout of the master page with
the content from the content page.
Execution of program in two ways.
1. Press F5 button OR
2. Right click on ASP.NET page (for e.g.: Default.aspx) and Select “View Browser”
option and select any browser for execution.
3. Refresh the page to see the different images.
Master Page
<%@ Master Language="C#" %>
<html>
<head runat="server" >
<title>Master page title</title>
</head>
<body>
<form id="form1" runat="server">
<table>
<tr>
<td><asp:contentplaceholder id="Main" runat="server" /></td>
<td><asp:contentplaceholder id="Footer" runat="server" /></td>
</tr>
</table>
</form>
</body>
</html>
Content Page
6. Lab Exercises:
[Purpose of this exercise is to use Validation controls .You can use Visual Studio
.NET environment to type the program. Execution of program in two ways.
1. Press F5 button OR
2. Right click on ASP.NET page (for e.g.: Default.aspx) and Select “View Browser”
option and select any browser for execution.
[Purpose of this exercise is to use ADO.NET technology for showing records in Grid
view from Database .You can use Visual Studio .NET environment to type the
program. Execution of program in two ways.
1. Press F5 button OR
2. Right click on ASP.NET page (for e.g.: Default.aspx) and Select “View Browser”
option and select any browser for execution.
[Purpose of this exercise is to use ADO.NET technology for inserting records into
Database .You can use Visual Studio .NET environment to type the program. Execution of
program in two ways.
1. Press F5 button OR
2. Right click on ASP.NET page (for e.g.: Default.aspx) and Select “View Browser”
option and select any browser for execution.
Default.aspx.cs
9. Lab Exercises:
Steps:
Default.aspx.cs
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
sda.SelectCommand = cmd;
using (Customers dsCustomers = new Customers())
{
sda.Fill(dsCustomers, "DataTable1");
return dsCustomers;
}
}
}
}
Quiz should be conducted on tips in the laboratory, recent trends and subject knowledge of the
subject. The quiz questions should be formulated such that questions are normally are from the
scope outside of the books. However twisted questions and self formulated questions by the
faculty can be asked but correctness of it is necessarily to be thoroughly checked before the
conduction of the quiz.
Teacher should oral exams of the students with full preparation. Normally, the objective questions
with guess are to be avoided. To make it meaningful, the questions should be such that depth of
the students in the subject is tested Oral examinations are to be conducted in co-cordial
environment amongst the teachers taking the examination. Teachers taking such examinations
should not have ill thoughts about each other and courtesies should be offered to each other in
case of difference of opinion, which should be critically suppressed in front of the students.
6. Submission:
Document Standard:
A] Page Size A4 Size
B] Running text Justified text
C] Spacing 1 Line
D] Page Layout and Margins (Dimensions in Cms)
Normal Page Horizantal
2.0
2.5
2.0
2.5
2.0
0.7”
2.0
2.0
Desription Font Size Boldness Italics Underline Capitalize
College Name Arial 24 ----- ------ Yes ----------
Document Title Tahoma 22 ----- ------ --------- ----------
Document Subject Century Gothic 14 ----- ------ --------- Capital
Class Bookman old Slyle 12 ----- ------ --------- ----------
Document No Bookman old Slyle 10 ----- ------ --------- ----------
Copy write inf Bookman old Slyle 9 ----- ------ --------- ----------
Forward heading Bookman old Slyle 12 ----- ------ Yes Capital
Forward matter Bookman old Slyle 12 ----- ------ --------- ----------
Lab man Contents title Bookman old Slyle 12 ----- ------ Yes Capital
Index title Bookman old Slyle 12 Yes ------ Yes Capital
Index contents Bookman old Slyle 12 ----- ------ --------- ----------
Heading Tahoma 14 Yes Yes Yes ----------
Running Matter Comic Sans MS 10 ----- ------ --------- ----------
Basic honesty in the evaluation and marking system is absolutely essential and in the process
impartial nature of the evaluator is required in the examination system to become popular
amongst the students. It is a wrong approach or concept to award the students by way of easy
marking to get cheap popularity among the students to which they do not deserve. It is a
primary responsibility of the teacher that right students who are really putting up lot of hard
work with right kind of intelligence are correctly awarded.
The marking patterns should be justifiable to the students without any ambiguity and teacher
should see that students are faced with unjust circumstances.