Reputation: 191
I know that if I want to redirect from asp.net page to anther in code behind I need to write-
Response.Redirect("SomePage.aspx");
My question is if is it possible to do the same thing in javascript function, and if it is so how?
thank you!
Upvotes: 12
Views: 66085
Reputation: 1838
Try this....
ScriptManager.RegisterStartupScript(this, this.GetType(), "onclick", "javascript:window.open( 'SomePage.aspx','_blank','height=600px,width=600px,scrollbars=1');", true);
Upvotes: 1
Reputation: 176
You can try this
window.location.href = 'page.aspx';
I dont know if is the best way
Upvotes: 0
Reputation: 59232
This should do:
window.location = "SomePage.aspx";
or
window.location.href="SomePage.aspx";
or
window.location.assign("SomePage.aspx");
Upvotes: 30