Click here to Skip to main content
15,907,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i tried but it is not working.

Result Screen as follows;


Label1 you are scored 80% of marks
Label2 sorry you are failed you have to attend the reexam again.



Login screen as follows;

studentid textbox1
studentname textbox2


i am writing the code in Result Screen page.

in the Result Screen page i have one button called Reexam

in that reexam button i want to write the code if the student failed,
then that studentid and studentname, will be displayed into the Login screen of textbox1 and textbox2 in the Login screen.



In the Reexam button code as follows; ( i write the code in the Result Screen page)


sql = "select s.StudId,s.StudName,s.Marks,b.class from studdet s, batch b where Marks < 59 and s.bthid = b.bthid and StudId = '" + Session["StudID"] + "'";
try
{
Dr = SCon.ReadSql(sql);
Dr.Read();
if (Dr.HasRows == true)
{
string strstudid = Dr[0].ToString();
string strstudname = Dr[1].ToString();
Session["StudID"] = strstudid;
Session["StudName"] = strstudname;
Dr.Close();
Response.Redirect("login.aspx");


}
}
catch (Exception ex2)
{
this.Label4.Text = ex2.Message.ToString();
return;
}

but when i run in the login screen student id and student name will not displayed in the textbox.

please help me.

i tried but it is not working?

Note : i want to write the code in the Result Screen page.

Regards,
Narasiman P.
Posted

1 solution

If you want to show StudID in Label1 or Label2.
use this
Label1.text=Session["StudID"].ToString();
Label2.text=Session["StudID"].ToString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900