dannystommen
November 25th, 2008, 04:10 AM
in the codebehind page I have a static member. I noticed that when I open my page twice, they both use the same member. Example:
private static int TestInt = 0;
protected void Page_Load(object sender, EventArgs e) {
TestInt++;
Label1.Text = TestInt.ToString();
}
When I open the page in IE (not debug mode in Visual Studio, pae is hosted in IIS), the text of the label is 1. When I open in another browser the same page, the text of the label is 2, so it uses the same member.
But I open the page on the same computer. What happens if this page is opened from another computer, will the label of the text then be 3? Or is a new member created for this page?
I hope I made myself clear.
private static int TestInt = 0;
protected void Page_Load(object sender, EventArgs e) {
TestInt++;
Label1.Text = TestInt.ToString();
}
When I open the page in IE (not debug mode in Visual Studio, pae is hosted in IIS), the text of the label is 1. When I open in another browser the same page, the text of the label is 2, so it uses the same member.
But I open the page on the same computer. What happens if this page is opened from another computer, will the label of the text then be 3? Or is a new member created for this page?
I hope I made myself clear.