Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET - Is it possible to trigger a postback from server code?

Is it possible to to programmatically trigger a postback from server code in ASP.NET? I know that it is possible to do a Response.Redirect or Server.Transfer to redirect to a page, but is there a way to trigger a postback to the same page in server code (i.e. without using javascript trickery to submit a form)?

like image 719
LJ. Avatar asked Sep 13 '08 16:09

LJ.


People also ask

What is the difference between postback and callback?

"A callback is generally a call for execution of a function after another function has completed." But if we try to differentiate it from a postback then we can say that it is a call made to the server to receive specific data instead of an entire page refresh like a postback.

What is postback event in ASP.NET with example?

Postback is actually sending all the information from client to web server, then web server process all those contents and returns back to client. Example: if (!IsPostback) // generate dynamic form else process submitted data; A postback originates from the client side browser.

In which .NET application or form does the postback event occur?

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


2 Answers

Asp.net Postbacks are initiated from the client (typically form submission). I am not sure what you are trying to achieve. Some of the server side page lifecyle events are already executed and what you are trying to do is raise the previous event handlers again.

like image 176
Gulzar Nazim Avatar answered Nov 16 '22 15:11

Gulzar Nazim


Postbacks are caused by a FORM submission. You need to initiate them from the client.

like image 30
FlySwat Avatar answered Nov 16 '22 15:11

FlySwat