I want to pass a value through pages so i tried with Application variable. But problem is variable is not unique for every user so value gets compromised.
Session Variable is used to create session and it works perfect.
I dont want to create session… i want to pass another value through each session and the value will differ according to user.
Here i create session for every faculty Logs in. And according to each faculty his schoolname is identified and transferred it to faculty welcome page.
if (pass == txtFacPass.Text && schoolName == listFacSch.SelectedItem.ToString())
{
Session["fac"] = txtFacUser.Text;
Application["sname"] = listFacSch.SelectedItem.ToString();
Response.Redirect("faculty.aspx", false);
}
Please help me with the solution ASAP. Thank You in Advance.
If I understood you correctly you want to pass two values to
faculty.aspx, the user name and the school name.You are already passing the user name through the session:
To pass another value just store it using a different key:
This will not cause another session to be created. Both values will be available in the other page in the one session created for the user.