Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcing a postback

Is there a way to force a postback in code?

I'm looking to force the raising of a postback from a method in the c# code behind my asp.net web application.

like image 606
shaun.breach Avatar asked Nov 21 '11 09:11

shaun.breach


People also ask

How do you postback in C#?

Clicking a button will increment the number of controls, but the new control will not be displayed until the Page_Load method fires on postback (after the next button click).

How do I turn off postback?

The postback on submit button can be avoided by giving return=false in the event handler function as below.

Can you explain AutoPostBack?

Autopostback is the mechanism by which the page will be posted back to the server automatically based on some events in the web controls. In some of the web controls, the property called auto post back, if set to true, will send the request to the server when an event happens in the control.

What is the use of IsPostBack property?

IsPostBack is used to check if the page is responding to a post back event, like clicking a button. So, lets say you have some textboxes for users to change some data and then click a button to submit the data.


1 Answers

You can try redirecting to same page.

Response.Redirect(Request.RawUrl);
like image 109
live-love Avatar answered Sep 28 '22 10:09

live-love