You are on page 1of 8

196170316502

PRACTICAL:5
Aim: create a web form where user enters following marks. Asp.net
iava, iss, project (all out of 100). When user submits the marks,
numeric value validation must be done. On entering marks, the
grade should be displaved in message box.

%> 90 and <<=100 AA


>80 and <<=90 AB
> 70 and <«=80 BB

6 0 and <<=67 BC

50 and<=60 CC
4 0 and <= 50 DD

Else Fail
1) DESIGN VIEW:
D cahen Juirs launch (CM4 P

FILE EDIT vew waSTE LD DBuG TEAM FoRMAT TABLE TOOLS TEST
ARCHITECTURS ANALYZ woow
L
-o- 2 -Coee O-Debu De inine 3Pane DduBIAF-L
bo
e r timber
- u
Nne tiame
Selien localhort 1051" ( pre
Eetes M k
liak

ASP NET|
d * d mumks
ebeonigs
JAVA mlit k

moarks
SS
mks
PROJECT|

(2) HTML CODE;


196170316502

Page Language="VB" AutoEventNireup="false"


CodeFile="Studentaaspxvb" Inherits="Student" %»

<IDOCTYPE html>

<html xnlns="http://www.w3.org/1999/xhtml">
<head runat-"server">
title></title»
<style type="text/css">

. auto-style1
width: 100%;

auto-style2 {
width: 279px; text-
align: right;
.auto-style3 {
width: 207px;
.auto-style4 {
text-align: center;
auto-styles {
text-align: center;
width: 279px;
auto-style6 {
width: 279px; text
align: right;
height: 42px;
auto-style7 {
width: 207px;
height: 42px;
.auto-style8 {
height: 42px;
.auto-style9
width: 279px; text-
align: right;
height: 32px;
.auto-style10 {
width: 207px;
height: 32px;
auto-style11 {
height: 32px;
#Reset1 width:
84px; height: 31px;
196170316502

auto-style12 f
text-align: center; width:
207px;

</style>
</head>
<body
<form id="form1" runat="server">
<div

<table class=""auto-style1" >


<tr
t d class="auto-style2">Enrollment No.</td»
t d class="auto-style3">
<aSpATextBox ID="TextBox1" runat="server" width="20@px">
/asp:TextBox>
</td>
ctd>
asRRequiredFieldvalidatorIp-"RequiredFieldvalidator1"
Cunat "server" ControTovalidate="TextBox1"
ErrerMessage="Enteryournumbec" Forecolor="Red">

/asp:RequiredFiel dvalidator
</td»
</tr
t
t d class="auto-style2">Name</td>
<td class=""auto-style3">
<asp:TextBoxID="Text Box2" tunat="server" Width="208px">
</asp:TextBox>
</td>
<td
<asR:RequiredFieldvalidater ID="RequiredFieldValidator6"
Cunat="server" ControToValidate="TextBox2" ErrorMessage="Enter your
name" ForeColor="Red"> </asp:RequicedFieldva1idator>
td>
</tr
tr
<td class=""auto-sttyle5">&nbsp; </td>
t d class="auto-style12"> Enter Marks</td>
<td class="auto-style4">&nbsSP; </td>
</tr
<tr
<td class="auto-style2">ASP.NET</td>
<td class="auto-style3">
<asPTextBox ID="TextBox3" runat="server" width="20@px">
/aspiTextBox>
</td>
<td>
196170316502

<asp:ReauiredFieldvalidator. ID="RequiredFieldvalidator2"
Cunat="server" ControlToValidate="TextBox3" ErrorMessage="Enter marks"
EoreColor="Red">
/a9P RequiredFieldValidator
<b
aspRengeValidator, ID="RangeValidator1" runat="server"
ControltoValidate="TextBox3" ErrorMessage="Enter valid marks"
Maximumyalue= "100" Minimumyalue="e" EoreColor="Red" Type="Integer">
</asp:RageValidator>
</td>
/t

<td class="auto-style2">JAVA</td>
t d class="auto-style3">
<asP:TextBox ID="Text Box4" runat="server" Width="200px">
</asRTextBox
</td>
td
<asp:RequiredFieldValidator ID="RequiredFieldValidator3"
cunat "server" ControlToValidate="TextBox4" ErrorMessage="Eter marks"
Forecolor="Red">

/asp:RequiredFieldvalidator
<asp:RangeValidator ID="Rangevalidator2" runat="server"
ControToValidate="TextBox4" ErrorMessage="Enter valid marks"
Maximunyalue="100" MininumValue= "0" ForeColor="Red" Type="Integer">
/asp:RangeValidator>
</td>
</tr
<tr
<td class="auto-style6">ISS</td»
<td class="auto-style7">
<SRTextBex ID="TextBox5" cunat="server" Width="200px">
s/aspTextBox
</td>
<td class="auto- styles">
<a5R:RequicedFieldValidator ID="RequiredFieldValidator4"
Cunat="server" ControlToValidate="TextBox5" ErrorMessage="Enter marks"
ForeColor="Red">
</asp:RequiredFieldvalidator>
aspiRangeValidator ID="RangeValidator3" runat="server"
ControlToValidate="TextBox5" ErrorMessage="Enter valid marks"
Maximumyalue="100" Minimumvalue="e" EoreColor="Red"
Type="Integer">
</asp:RangeValidator>
</td>
</tr
196170316502

<td class="auto-style2">PR0JECT</td>
t d class="auto-style3">
aSRTextBox ID="TextBox6" cunat="server" Width="200px"
/asR:TexTBex>
</td>
<td>
<aspiRequicedFieldvalidator. ID="RequiredFieldvalidators"
cunat-"server" ControlTovalidate="TextBox6" ErrorMessage="Enter marks"
EoreColer="Red">
/asp:RequiredFieldvalidator
<br />
<asp:Rengevalidator ID="RangeValidatorg"
Cunat-"server" ControJToValidate="Text Box6" ErrocMessage="Enter valid
marks" MaxinumValue="100" Minimunyalue="e" EoreColor="Red"
Type="Integer">

/asR:RangeValidator
</td>
/tr
<td class="auto-style9"></td>
<td class="auto-style10">
asRButton ID="Button1" CUnat"server"
Height="31px" Text="Submit" width="94px" />
<input id="Reset1" type="reset" value="reset"
/>«/td>
<td class="auto-style11">
&nbsP; </td>
</t
</table
</div
</form>
</body
</html

(3) SOURCECODE:
Partial Class Student
Inherits System,web.UTPaER

Protected Sub Button1_Click(sender As Object, e As EventArgs)


Handles Button1.Click

Dim Eng As String


Eng TextBox1. Text() + "<br />"
196170316502

BesponseWcite( "Enrollment no:: " +Ene)


Dim Name As String
Name TextBox2.Text() "<br />" + "<hr />"
BesponseWrite( "Name: " + Name)

Respense.Write("<br /> Your Marks")


Dim aspAs Decimal asp

TextBox3.Text ()
Besponse.Write(" <bc />ASP:" asp.Tostring)

Dim java As Decimal


java TextBox4.Text ()
ReSponseWitel" <br />3AVA:" + javaToString)

Dim iss
As
iss, = Text Box5.Text()
Decimal1
ResponseWrite(" <br />TSS:: " iss.Tostring)
Dim pro As Decimal
pro = TextBox6. Text ()

ResponseNrite(" <br />PROJECT: " PraJoString)


Dim Total As Decimal
Total asp + java + iss+ pro
BeSPonseMritel" <br />TOTAL=" + TotalTOString)

Dim per As Decimal


per Total / 4

BeSPODseWrite("<br />PER:-" perToString)


If per 90 Then
BesPOnse.Write(" <br />Your Grade is AA")

80 Then
ELSeTt per
Besponse.Wcitel" <br />Your Grade is AB")

ElseIf per 70 Then


BesponseWeite(" <br />Your Grade is BB")

ElseIf (per 60) Then


BesponseWrite(" <br />Your Grade is BC")

ElseIf (per 50)


Then
BeSPonserite(" <br />Your Grade is CC")

ElseIf (per 4 0 ) Then


Response.Writel" <br />Your Grade is DD")

Else
196170316502

BesponseWrite( "Fail")
End If

End Sub
End Classs

4) OUTPUTVIEW:
.

localhost 10516/Student. x
cabor:10 1b/stucent.a
Eroliment No j166170316012
N a n e Harsh

EnferMarks

ASP:NET
JAVA P

ISS

PROJECT J0

Submi et

2
x
ocalint 0516 hadent
7 localhost 105 16/5thudent.aspx
olmentna.:166170316012
Name: Harsh

Yaut Mark
ASP
ISS 30
PROJECT-B
AL
Your Grade in BB

3.
196170316502

wahone 1956ade
locaost 1016/Student.arpr
Enrolimenit No E e ryour mber

ASPNET|10
Bae ma
JAVA

ISs 201
valad u

PROJECT|

Sulel

You might also like