IFRAME :How do i prevent URL change and new window opening.

Need technical advice on coding your web pages? Covers HTML, JavaScript, CSS, and some server side technologies. Also the issue of some webpages not displayed well.

Moderator: Don_HH2K

IFRAME :How do i prevent URL change and new window opening.

Postby dotnetprof2005 » Sun 28 Aug, 2005 4:39 pm

I have this HTML code
<IFRAME src="servername/directoryname/login.aspx" height="800" width="900"></IFRAME>
I save this code as an .htm file on my desktop(path:C:\Documents and Settings\computername\Desktop) and when i open this page it loads login.aspx in the same window and WITHOUT changing the URL as well.But when i go further on it by clicking the "login" button on the login.aspx page it changes the Path to URL(http://Localhost/...) and i am actually browsing my ASP.NET application instead of remaining in the same window with the same path.I do nt want the path to change at all and all the pages should be loaded in the same page with no change to URL.
Can any one please suggest something on it as it is very urgent for me to move on by fixing this issue????
Thanks in advance...
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511
dotnetprof2005
dotnetprof2005
junior member
junior member
 
Posts: 9
Joined: Sun 28 Aug, 2005 3:27 pm

Postby Don_HH2K » Sun 28 Aug, 2005 4:46 pm

By my guess, the contents of the iframe are using a script similar to this to make sure that it opens as the top frame:

Code: Select all
if (top.location != self.location)
    {
    top.location = self.location;
    }

A workaround may be to disable JavaScript for that page, but that may result in the login page not working properly.
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.11) Gecko/20050728 Donzilla/0.8PR1 (WML/1.3)
Last edited by Don_HH2K on Sun 28 Aug, 2005 4:48 pm, edited 1 time in total.
Laptop: HP Compaq nx6325 - Turion 64 X2 @ 2GHz, 2GB DDR2, 100GB HD, ATI Radeon X300, 15" LCD, Seven Pro
Handheld: Palm Treo 650 - Intel PXA270 @ 312MHz, 10MB RAM, 32MB flash, 2.7" LCD, Palm OS 5.4
User avatar
Don_HH2K
Moderator
Moderator
 
Posts: 5112
Joined: Sun 09 May, 2004 3:59 pm

Postby Pu7o » Sun 28 Aug, 2005 5:46 pm

Shouldn't this be on the "Web Design" subforum?
UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/85.8.2 (KHTML, like Gecko) Safari/85.8
User avatar
Pu7o
Macfox
Macfox
 
Posts: 2014
Joined: Thu 06 Jan, 2005 12:03 pm
Location: Portugal

Postby Andrew T. » Sun 28 Aug, 2005 6:15 pm

Pu7o wrote:Shouldn't this be on the "Web Design" subforum?


Moved.
UserAgent: Mozilla/5.0 (Windows; U; Win95; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
User avatar
Andrew T.
diamond member
diamond member
 
Posts: 1228
Joined: Fri 14 Mar, 2003 11:37 pm
Location: Somewhere beyond the sea

IFRAME :How do i prevent URL change and new window opening

Postby dotnetprof2005 » Tue 30 Aug, 2005 7:06 pm

Awesome, thank you very much for the help.I just followed what you said and it worked.
Thanks
UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
dotnetprof2005
dotnetprof2005
junior member
junior member
 
Posts: 9
Joined: Sun 28 Aug, 2005 3:27 pm


Return to Web Design and Page Coding

Who is online

Registered users: Google [Bot]