- #1
DemiAngel
- 1
- 0
Hi, I'm working on a students marks evaluation webpage, unfortunatly i run into several problems and i need some help fixing it
Mainly i can't fix the #line error that i always get and i can't make the if-else statements to work
Please help me out & thanks,
Code:
<%@ Page Language="C#" %>
<script runat="server">
void submit(object sender, System.EventArgs e)
{
lblMessage1.Text = TextBox1.Text;
lblMessage2.Text = TextBox2.Text;
lblMessage3.Text = DropListItem.SelectedItem.Text;
}
void Calculate(Object sender, System.EventArgs e)
{
int TotalGrade = Convert.ToInt32(TextBox3.Text) +
Convert.ToInt32(TextBox4.Text) + Convert.ToInt32(TextBox5.Text);
lblMessage4.Text = TotalGrade.ToString();
}
int Result
{
get { return Convert.ToInt32(lblMessage4.Text); }
if (TotalGrade <= 100 || TotalGrade >= 90)
lblMessage5.Text = "A, Excellent!";
}
else
{
if (TotalGrade <= 89 || TotalGrade >= 80)
lblMessage5.Text = "B, Very Good!";
}
else
{
if (TotalGrade <= 79 || TotalGrade >= 70)
lblMessage5.Text = "C, Good!";
else
{
if (TotalGrade <= 69 || TotalGrade >= 60)
lblMessage5.Text = "D, Not Bad!";
else
{
if (TotalGrade <= 59 || TotalGrade >= 50)
lblMessage5.Text = "E, Work Harder!";
else
{
if (TotalGrade <= 49)
lblMessage5.Text = "F, You Failed!";
</script>
<html>
<head>
<title></title>
</head>
<body dir="ltr">
<form runat="server">
<p align="center">
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u></u></font></strong>
</p>
<p align="center">
<strong><font size="5"><u>Personal Information Form</u></font></strong>
</p>
<p align="center">
<strong>Enter the Student Name :</strong>
</p>
<p align="center">
<em><u>Student Name</u>:
<asp:TextBox id="TextBox18" runat="server" Width="179px"></asp:TextBox>
</em>
</p>
<p align="center">
<strong>Enter the Student ID number :</strong>
</p>
<p align="center">
<em><u>Student ID</u>:
<asp:TextBox id="TextBox19" runat="server" Width="179px"></asp:TextBox>
</em>
</p>
<p align="center">
<strong>Select Subject Code From the List:</strong>
</p>
<p align="center">
</p>
<p align="center">
<asp:DropDownList id="DropDownList4" runat="server">
<asp:ListItem>CIS 101</asp:ListItem>
<asp:ListItem>CIS 102</asp:ListItem>
<asp:ListItem>CIS 103</asp:ListItem>
<asp:ListItem>CIS 110</asp:ListItem>
</asp:DropDownList>
</p>
<p align="center">
_________________________________
</p>
<p align="center">
<font size="5"><strong><u>Student Grade Evaluation Form</u></strong></font>
</p>
<p align="center">
<strong>Enter the Student Grades:</strong>
</p>
<p align="center">
<em>First Grade:</em>
<asp:TextBox id="TextBox15" runat="server" Width="180px"></asp:TextBox>
</p>
<p align="center">
<em>Second Grade:
<asp:TextBox id="TextBox16" runat="server" Width="180px"></asp:TextBox>
</em>
</p>
<p align="center">
<em>Final Grade: <asp:TextBox id="TextBox17" runat="server" Width="180px"></asp:TextBox>
</em>
</p>
<p align="center">
<em>============================= </em>
</p>
<em></em><em>
<p align="center">
<asp:Button id="Button2" onclick="submit" runat="server" Width="287px" Text="Get Student Information Now"></asp:Button>
</p>
<p align="center">
<asp:Button id="Button3" onclick="Calculate" runat="server" Width="286px" Text="Get the Total Grade Now"></asp:Button>
</p>
</em><em>
<p align="center">
Student Name: <asp:Label id="lblMessage1" runat="server"></asp:Label>
</p>
<p align="center">
Student ID: <asp:Label id="lblMessage2" runat="server"></asp:Label>
</p>
<p align="center">
Student Selected Subject: <asp:Label id="lblMessage3" runat="server"></asp:Label>
</p>
</em>
<p align="center">
<em>Total Grade: </em><asp:Label id="lblMessage4" runat="server" font-italic="True"></asp:Label><em></em>
</p>
<p align="center">
<em></em>
</p>
<p align="center">
<em> Evaluation Letter: </em><asp:Label id="lblMessage5" runat="server" font-italic="True"></asp:Label><em></em>
</p>
</form>
</body>
</html>
Mainly i can't fix the #line error that i always get and i can't make the if-else statements to work
Please help me out & thanks,