How can I put variables that have scope the whole session on ASP.NET Page (I mean in the class that stands behind the aspx page)? Is the only way to put the variable in the Session object?
For example:
public partial class Test_ : System.Web.UI.Page
{
private int idx = 0;
protected void Button1_Click(object sender, EventArgs e)
{
Button1.Text = (idx++).ToString();
}
}
I want on every click on this button my index to go up. How can I do this without using the Session object?