J
Johnny Luner
I have a base class (root.cs) and all my pages inherits from it. When I
access default_1.aspx, it changes the base class variable intentionally.
Now, when I close the browser launch a new I.E. to access default_2.aspx,
it shows "changed!!" on my screen! I assume launching new browser would
start a new instance everything. Can anyone explain why? thanks...
------------------------------------------------------------
root.cs (this file is compiled and put in /bin directory)
------------------------------------------------------------
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace company {
public class main : Page {
public static String my_string = "hello world";
}
}
------------------------------------------------------------
default_1.aspx
------------------------------------------------------------
<%@ Page Inherits="company.main" %>
<script language="c#" runat="server">
void Page_load(Object sender, EventArgs e) {
my_string = "changed!!!";
}
</script>
access default_1.aspx, it changes the base class variable intentionally.
Now, when I close the browser launch a new I.E. to access default_2.aspx,
it shows "changed!!" on my screen! I assume launching new browser would
start a new instance everything. Can anyone explain why? thanks...
------------------------------------------------------------
root.cs (this file is compiled and put in /bin directory)
------------------------------------------------------------
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace company {
public class main : Page {
public static String my_string = "hello world";
}
}
------------------------------------------------------------
default_1.aspx
------------------------------------------------------------
<%@ Page Inherits="company.main" %>
<script language="c#" runat="server">
void Page_load(Object sender, EventArgs e) {
my_string = "changed!!!";
}
</script>