Home All Groups Group Topic Archive Search About
Author
18 May 2005 2:26 AM
Amelyan
I need some help to confirm my theory!
I think I discovered something new for myself about behavior
System.Web.UI.Page.

THEORY: Every time I change control on my WebForm1 page that results in
PostBack, it is handled by a new instance of WebForm1 class, i.e. a new
instance of WebForm1 class is created every time.  In general, any GET or
POST to WebForm1 will get its own new instance of WebForm1.

public class WebForm1 : System.Web.UI.Page
{
}

Is my theory correct?  I wasn't able to find confirmation or contradiction
to my theory in my asp.net books.

Thank you,
-Amelyan

Author
18 May 2005 9:29 AM
Black.Coffee
Hi, I think you are right,if you refresh page or postback,server will buid a
new instance of webform,and response to i.e.

reference:http://msdn.microsoft.com/library/en-us/dnaspp/html/aspnet-pageobjectmodel.asp?frame=true


Show quoteHide quote
"Amelyan" <bamel***@wi.rr.com> дÈëÏûÏ¢
news:ugvgPE1WFHA.2348@TK2MSFTNGP14.phx.gbl...
>I need some help to confirm my theory!
> I think I discovered something new for myself about behavior
> System.Web.UI.Page.
>
> THEORY: Every time I change control on my WebForm1 page that results in
> PostBack, it is handled by a new instance of WebForm1 class, i.e. a new
> instance of WebForm1 class is created every time.  In general, any GET or
> POST to WebForm1 will get its own new instance of WebForm1.
>
> public class WebForm1 : System.Web.UI.Page
> {
> }
>
> Is my theory correct?  I wasn't able to find confirmation or contradiction
> to my theory in my asp.net books.
>
> Thank you,
> -Amelyan
>