Is there a difference between me using Javascript to redirect to URL + “?Querystring=value” versus using whatever mechanism ASP.NET uses?
If there is a difference, how can I make the rendered ASP.NET page be submitted to the same URL with a different query string by javascript?
If you want to do a post back just like a asp control like a
asp:Buttonyou can use the javascript functions included by the framework to do so:You can read more about the
__doPostBackin this article:Doing or Raising Postback using __doPostBack() function from Javascript in Asp.Net
Just doing a
form.submit()will not be exactly the same as using__doPostBack.To answer the first part of your question there is no difference doing a redirect if you are just doing a
Response.Redirectas the will both do aGET. The difference is if you use aasp:Buttoncontrol for instance, it will access your page first to handle the button (a post back) and then do aGETon the redirected page.If you want to submit to the same URL (eg post your data) then you should use the
__doPostBackmethod. If you don’t require the data to be posted, then just do a redirect in javascript to the same URL with a modified query string (which will just do a basicGET) but your data will not be posted.