Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force a postback with asp.net and C#

I have a demo scheduled with a client and i need a quick and dirty fix for now. I will find a more appropriate work around tomorrow but for the time being i need a way to force a post back, or refresh the page.

i tried:

Response.Redirect("");

but it brings me to a page that says "Object moved to here". 'here' is a hyperlink that brings me to the page with desired results but i wish to bypass this message.

Any ideas.

like image 276
ErnieStings Avatar asked Sep 13 '09 18:09

ErnieStings


2 Answers

Response.Redirect("default.aspx");

(or whatever the name of the current page is)

like image 141
Travis Collins Avatar answered Sep 29 '22 16:09

Travis Collins


Response.Redirect(Request.RawURL); 

This also works and you won't need to worry about putting in the path.

like image 40
bds89 Avatar answered Sep 29 '22 17:09

bds89