Q:

How do I do a Javascript Redirect in asp.net

I have a asp.net webform with a button. The OnClientClick event is wired to a javascript function.
I need this function to redirect the current page to this page.
After much reading is have tried all the following, but to no avail:
           var url = "http://www.google.com";
           document.location = url; //Doesn't Work
           document.location.href = url; //Doesn't Work
           window.location = url; //Doesnt Work
           window.location.href = url; //Doesnt Work

Any Help or advice are welcome.
Ps. I am entering the JS function as my alert message pops up

A:

You probably have somewhere on your code a Javascript Error, that stop the execution, because as the other say, this code that you say that "doesnt work", it's work fine.

