c# ,webforms,vs2003, frames
i have a web form that have two frames top frame and main frame
and the top frame contains all the links to the pages wich is loaded in the main frame
and lets say i have 2 web forms (webform1 & webform 2.
my problem is every time i change web form using the links at run time what ever the veriable values that was left on the other page nerver changes to thair original state like when the page is loaded at the fist time
lets say i have a cal culculation in the fist webform1 which is dis played on the page load and the second one the same way as the first
when the fist page loads it gives me the answer =3
and when i go to the second page and it gives me the answer =3
again
when i come back to the first one it gives me the answer =6 and go to the second it gives me the answer =6
whey is this happening why arn't the variables getting re-initialized
please help m
webform1 (statrting form)
namespace sen
{
public class Products : System.Web.UI.Page
{
int total=0;
int var1=1;
int var2=2;
private void Page_Load(object sender, System.EventArgs e)
{
int total=var1+var2;
lblno.Text=total.ToString();
}
}
}
webform2
namespace sen
{
public class Products : System.Web.UI.Page
{
int total=0;
int var1=1;
int var2=2;
private void Page_Load(object sender, System.EventArgs e)
{
[COLOR="Red"]int total=var1+var2;[/COLOR]
lblno.Text=total.ToString();
}
}
}