F
Flare
Hi im trying to prevent people from useing more than one browser to view my
page.
But first i need to know excatly how static members of a form class is
behaving.
When is the IntanceCounter (see ***) desctructet?(reset) When the IIS server
is restaret? Then Browser close? Im getting diffrent results everytime i try
this.
I have something like this:
----------------------------
The ASPX
----------------------------
<form id="Form1" method="post" runat="server">
<% Response.Write(WriteHtml()); %>
</form>
----------------------------
codebehind
----------------------------
static int Instancecounter =0; // *** Here is the instanceCounter
public string WriteHtml()
{
if(counter == 0)
{
Instancecounter++;
return "The HTML to render";
}
else
{
return "Only one browser please";
}
}
page.
But first i need to know excatly how static members of a form class is
behaving.
When is the IntanceCounter (see ***) desctructet?(reset) When the IIS server
is restaret? Then Browser close? Im getting diffrent results everytime i try
this.
I have something like this:
----------------------------
The ASPX
----------------------------
<form id="Form1" method="post" runat="server">
<% Response.Write(WriteHtml()); %>
</form>
----------------------------
codebehind
----------------------------
static int Instancecounter =0; // *** Here is the instanceCounter
public string WriteHtml()
{
if(counter == 0)
{
Instancecounter++;
return "The HTML to render";
}
else
{
return "Only one browser please";
}
}