Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems navigating frames using onclick

Status
Not open for further replies.

trueneutral

Programmer
Sep 15, 2003
13
CA
Okay I have a very odd error that nobody can figure out. I'm using frames, and I'm trying to send a string through the frames.

<input onclick=&quot;window.parent.frames.item(1).location = '<%=forwardLink%>';window.navigate('topbar.aspx?file=<%=forwardFile%>') &quot; type=button value=&quot;>&quot; name=Forward>


item(1) is the bottom frame which is recieving a link to a PDF file. That loads up just fine.

topbar.aspx?file=<%=forwardFile%> is recieving a file path name to a PDF file. Here's where it goes wrong. When I response.write that forwardFile variable, I get this result (The correct result):

d:\inetpub\ Of Mechanical Standards \Section 1\2C-01.05.pdf

But if you look at what's being sent to the address bar it looks like this:

d:inetpub Of Mechanical Standards Section 1C-01.07.pdf

All the slashes in the string are being stripped! Does anyone know what's going on?
 
Okay nevermind, I got it figured out.
I don't know why, but for some reason whenever I sent a path file I would get this error. So I redid my code to accept a link instead and then convert it into a path file if needed. Very frustrating.

Anyway For frames you can use this:

window.parent.location.href ='navBar.aspx'

which would reload the frames page.


Or... If you want to reload an individual frame you can do:

window.parent.frames.item(1).location = bottomFrame.aspx'

(1) would be the second frame on your page
 
also side note for you, that was a java not asp question [smile2]
 
True. I realize that, but at the same time I wasn't sure where the problem actually lied. In fact, I'm still a little unsure which aspect of the code is actually at fault. Because the behind processing was being done by ASP.NET and the frame navigation done by Javascript, the lines start to become blured. It seems that the Javascript was at fault with the error, but the solution was solved with ASP.NET

Do you still believe that it belongs as a javascript problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top