Update
I'm implementing a custom page caching solution and I don't want the request to be cached or retrieved from the cache if it's in response to a form submission or some sort of asp.net postback.
I'm trying to figure out if the current HttpRequest is a postback. Is there a way of doing this outside the context of a page or other usercontrol? In otherwords if I'm inside an HttpModule I don't have access to this.IsPostBack
but I still need to determine if it is in fact a postback.
Also, are postbacks always "Post" requests or is that determined by containing form?
thanks!
Which property is used to identify the Page is Post Back in ASP.NET? Page. IsPostBack property is use to check wheather page is post back.It return bool value.
IsPostBack property will be set to true when the page is executing after a postback, and false otherwise. We can check the value of this property based on the value and we can populate the controls on the page.
PostBack is the name given to the process of submitting an ASP.NET page to the server for processing. PostBack is done if certain credentials of the page are to be checked against some sources (such as verification of username and password using database).
A Postback Event is a string of information that is sent to a network's specific URL that contains information about the post-install event pertinent to the network.
Check the Method
property of the HttpWebRequest
. Postbacks should be marked as POST
in the Method
.
Also, the way you did it in old-school asp was to check for expected post-back parameters in the body of the HTTP message (Request.Form
). You could check the content of the request for data that looks like postback parameter. I'm not sure what object exactly you're working with, but if it's an HttpWebRequest
, you might check the request stream from the GetResponseStream()
method of the object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With