user3475785
user3475785

Reputation: 191

Redirect from asp.net page to another using javascript function

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

Answers (3)

Jameem
Jameem

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

BFigueiredo
BFigueiredo

Reputation: 176

You can try this

window.location.href = 'page.aspx';

I dont know if is the best way

Upvotes: 0

Amit Joki
Amit Joki

Reputation: 59232

This should do:

window.location = "SomePage.aspx";

or

window.location.href="SomePage.aspx";

or

window.location.assign("SomePage.aspx");

Upvotes: 30

Related Questions