Link to home
Start Free TrialLog in
Avatar of eshurak
eshurakFlag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of Saqib Khan
Saqib Khan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eshurak

ASKER

Thanks for your response.  I did not write this code so I'm not sure what's going on.

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.
> 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.