Thursday, October 11, 2012

Solved... IE 8 navigation issue when using "Request.UrlReferrer.ToString();" and javascript navigation...

Solved... IE 8 navigation issue when using "Request.UrlReferrer.ToString();" and javascript navigation...

Scenario: I have a page1.aspx where I have a button and JS click event with window.location.href to page2.aspx. Now when I click cancel on page2.aspx it should nav back to page1.aspx. But since IE8 has security restrictions, it gives “Request.UrlReferrer” as NULL and cant navigate back.

Resolution: when you know you are just going to navigate why to use javasript. Just wrap the button around a href and it will work J also same href can b clicked using a JS right?

J

#trivedimehulk@gmail.com