First Program
code for student result
using System;using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Styles_Default : System.Web.UI.Page
{
string name;
int age;
int sub1;
int sub2;
int sub3;
int sub4;
int sub5;
int temp;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
name = TextBox9.Text;
Label10.Text = name.ToString();
sub1 = int.Parse(TextBox8.Text);
sub2 = int.Parse(TextBox4.Text);
sub3 = int.Parse(TextBox5.Text);
sub4 = int.Parse(TextBox6.Text);
sub5 = int.Parse(TextBox7.Text);
temp = sub1 + sub2 + sub3 + sub4 + sub5;
Label8.Text = temp.ToString();
}
protected void Button2_Click(object sender, EventArgs e)
{
int per;
name = TextBox9.Text;
Label10.Text = name.ToString();
sub1 = int.Parse(TextBox8.Text);
sub2 = int.Parse(TextBox4.Text);
sub3 = int.Parse(TextBox5.Text);
sub4 = int.Parse(TextBox6.Text);
sub5 = int.Parse(TextBox7.Text);
temp = sub1 + sub2 + sub3 + sub4 + sub5;
per = temp * 100 / 500;
Label9.Text = per.ToString();
}
protected void Button3_Click(object sender, EventArgs e)
{
name = TextBox9.Text;
Label10.Text = name.ToString();
sub1 = int.Parse(TextBox8.Text);
sub2 = int.Parse(TextBox4.Text);
sub3 = int.Parse(TextBox5.Text);
sub4 = int.Parse(TextBox6.Text);
sub5 = int.Parse(TextBox7.Text);
if (sub1 < 30)
{
Label3.Text = "fail";
}
else
{
Label3.Text = "pass";
}
if (sub2 < 30)
{
Label4.Text = "fail";
}
else
{
Label4.Text = "pass";
}
if (sub3 < 30)
{
Label5.Text = "fail";
}
else
{
Label5.Text = "pass";
}
if (sub4 < 30)
{
Label6.Text = "fail";
}
else
{
Label6.Text = "pass";
}
if (sub5 < 30)
{
Label7.Text = "fail";
}
else
{
Label7.Text = "pass";
}
}
}