by Guest » 08 Feb 2025, 15:03
Wie öffne ich eine externe URL (sagen wir google.com) in einem neuen Browserfenster /einer Registerkarte von MVC Controller. Klicken Sie auf den Erfolge /Fehler.
Code: Select all
//Controller code
public ActionResult Index( )
{
--Do some logic
if(logicpasses)
{
return Redirect("http://google.com"); -- This doesn't work out as it's navigating to the URL in the same tab
return JavaScript("Window.open('http://google.com')"); -- This is not working as well
}
else
{
return Redirect("http://google.com");
}
}
Wie öffne ich eine externe URL (sagen wir google.com) in einem neuen Browserfenster /einer Registerkarte von MVC Controller. Klicken Sie auf den Erfolge /Fehler.
[code] //Controller code
public ActionResult Index( )
{
--Do some logic
if(logicpasses)
{
return Redirect("http://google.com"); -- This doesn't work out as it's navigating to the URL in the same tab
return JavaScript("Window.open('http://google.com')"); -- This is not working as well
}
else
{
return Redirect("http://google.com");
}
}
[/code]