Dinesh Kumar
asked on
mvc redirect question
Hi Experts,
Please see below code:
HTML
MVC:
but it goes to http://localhost:33419/Home/window.open('http://www.google.com','_blank');
and it says HTTP Error 404.0 - Not Found
I want to open google.com in new tab.
return Redirect(url); is also not working.
thanks
meetDinesh
Please see below code:
HTML
<input type="button" id="btnManage" value="ManageActivation" onclick="Test()" />
function Test() {
debugger;
location.href = "/Home/GetTest";
}
MVC:
public ActionResult GetTest()
{
string url = "window.open('http://www.google.com','_blank');";
return new RedirectResult(url, false);
}
but it goes to http://localhost:33419/Home/window.open('http://www.google.com','_blank');
and it says HTTP Error 404.0 - Not Found
I want to open google.com in new tab.
return Redirect(url); is also not working.
thanks
meetDinesh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.
public ActionResult MA(MA inputs)
{
return Content(script); //script contains window.open('.. like string.
}
var callBackFunction = function (result) {
var tmpFunc = new Function(result); //also avoided eval
tmpFunc();
}
public ActionResult MA(MA inputs)
{
return Content(script); //script contains window.open('.. like string.
}
var callBackFunction = function (result) {
var tmpFunc = new Function(result); //also avoided eval
tmpFunc();
}
Thanks for sharing!
Open in new window
?