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

L

lander

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

Would somebody detail this, thanks very much...
 
M

Madhur

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.
 
M

Michael Nemtsev [MVP]

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>
 
M

Madhur

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
 
S

Sergey Zyuzin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top