eshurak
asked on
Using JavaScript to goto another aspx in ASP.NET
Hello,
Using JavaScript I'd live to redicted my user to a difference aspx page in my ASP.NET 2.0 project within the same browser window. Currently I have:
var oForm = document.forms[0];
oForm.action = "Report.aspx?ReportType=" + reportType;
But that open a new browser. I'd like this to be in the same browser.
Thanks
Using JavaScript I'd live to redicted my user to a difference aspx page in my ASP.NET 2.0 project within the same browser window. Currently I have:
var oForm = document.forms[0];
oForm.action = "Report.aspx?ReportType=" + reportType;
But that open a new browser. I'd like this to be in the same browser.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> oForm.target = '_reportWin';
in you orignal post you did not mention "target" line, target will open form in a new window. and yes that was the problem.
in you orignal post you did not mention "target" line, target will open form in a new window. and yes that was the problem.
ASKER
I left out the submit part.
oForm.target = '_reportWin';
oForm.submit();
If I comment out the target it stays in the same browser and I'm pretty happy with that. I tried document.location but it gives me an error message so I'll stick with the oForm method.