I hava an aspx page and I need to response.redirect to the same page. I am doing while clicking on a button. Can i possible to do it in javascript.
I tried window.location=url;
. I want to know how <% Response.Redi开发者_如何学JAVArect(url) %>
can be called in javascript?
To redirect in javascript you need to use the window.location
property:
window.location = '<%= ResolveUrl("~/test.aspx") %>';
Response.Redirect
cannot be called in Javascript, that is a server side bit of code. window.location
does effectively the same job.
In your HTML, where you declare your button, add this.
<input type="button" name="submit" value="submit" onclick="window.location(YOUR REDIRECT URL)" />
精彩评论