How does asp.net know whether it is a postback or not??

  • Thread starter Thread starter lander
  • Start date Start date
L

lander

How does asp.net know to set the Page.IsPostBack property exactly???

Would somebody detail this, thanks very much...
 
lander said:
How does asp.net know to set the Page.IsPostBack property exactly???

Would somebody detail this, thanks very much...

When the page is submitted, the ID of control is also sent which caused the
postback.
And because of this ID, ASP.NET is able to execute the event handler for
that control.

I think thats how ASP.NEt differentiates between the new request and
postback.
 
Hello Madhur,

Each server control implements IPostBackEventHandler interface, where the
RaisePostBackEvent is used.
IsPostBack return true if PostBack event was raised.

You can find more discussion there http://forums.asp.net/t/1198506.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


M> how ASP.NEt differentiates between the new request and postback
M>
 
Michael said:
Hello Madhur,

Each server control implements IPostBackEventHandler interface, where
the RaisePostBackEvent is used.
IsPostBack return true if PostBack event was raised.

You can find more discussion there
http://forums.asp.net/t/1198506.aspx
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo
how ASP.NEt differentiates between the new request and postback

Thanks Michael
 
How does asp.net know to set the Page.IsPostBack property exactly???

Would somebody detail this, thanks very much...

Well, looking at Page class with Reflector it seems there are few
rules that affect the flag. For the most part its value depends on
whether request has __VIEWSTATE or __EVENTTARGET parameters.

Thanks,
Sergey
 
Back
Top