Click here to Skip to main content
15,883,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I was going through an Asp.net project file.
In that they are navigating to a htm page when session got expired or session variable is null or empty like this

C#
if (Session["UserID"] == null)
           {
               Response.Redirect("Expired.htm");
           }


in that htm. in onload function following piece of javascript is there

JavaScript
function SessionExp()
                {         
                    if(window.parent.length > 0) 
                    {
                        window.parent.location.replace(document.URLUnencoded);                   
                    }      
                 }

My doubt is that what is window.parent.length,document.URLUnencoded means and sometimes document.URLUnencoded reurns Nan, what is the meaning of that one?.
And if i open this website in two browser tabs and logout from one tab,and i clicked on any page on the second tab, instead of navigating to Expired.htm it is showing error message

> The resource cannot be found.

> Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /website1/folder1/undefined

how undefined came??
Note: Iframes are used.

Anyone Pls explain this....
Posted

1 solution

The URLUnencoded property[^] is a non-standard, Internet Explorer specific property. You cannot use it from any other browser. The location.href property[^] should return the value you need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900