PDA

Click to See Complete Forum and Search --> : IIS & Frames


coox
Apr 20th, 2001, 05:45 AM
Can anyone tell me how (if?) I can catch a click in one frame and thence make another frame refresh/rewrite (whatever)?

Also, is there some way in HTML to overide the font size where the user may have changed it (like when you hold ctrl and spin your mouse wheel)?

JoshT
May 1st, 2001, 06:37 AM
1. Provider you have given your frames names, you write the link like <a href="page.html" target="framename">Blah</a>.

2. I believe CSS specs give precendence to the user's personal style sheet. It's a bad idea anyway, the user usually has good reason to override your style (bad eyesight, etc).

monte96
May 1st, 2001, 10:35 AM
If you specify a specific size for fonts in a stylesheet or a style tag, it will prevent the ctrl+mouse wheel from changing the size..

For instance, try it when posting and you'll see that the text inside the textarea is not effected. That is because of this line:


TEXTAREA {BACKGROUND-COLOR: #cccccc; COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px}


It locks it at a 12pt font.

coox
May 2nd, 2001, 10:08 AM
I'm using frames, and I'm really looking to see if I can update a different frame to the one the user clicked in. Kind of like the WriteTemplate thing (or even Response.Write) but not back to the current frame.

Thanks for all your help anyway...

monte96
May 2nd, 2001, 11:27 AM
Also, is there some way in HTML to overide the font size where the user may have changed it (like when you hold ctrl and spin your mouse wheel)?
I was answering your 2nd question...

JoshT already answered your first..

coox
May 3rd, 2001, 03:07 AM
Actually, I didn't ask the original correctly, I realise now.

What I actually want to do is, from an IIS application, write to any frame in a framset, and not just the one that the user last clicked in. Is this possible?

Sundance Kid
May 3rd, 2001, 06:49 AM
Main.htm
<HTML>
<FRAMESET COLS="20%,40%,40%">
<FRAME NAME="MAIN" SRC="frame1.htm">
<FRAME SRC="frame2.htm">
<FRAME SRC="frame3.htm">
</FRAMESET>
</HTML>
Frame1.htm
<HTML>
<HEAD>
<SCRIPT Language="VBScript">
Sub RefreshBtn_onClick
If Text1.Value <> "" Then
set win = top.frames(Text1.Value - 1)
win.History.go 0
End If
End Sub
</SCRIPT>
</HEAD>

<BODY>
Enter the number of the frame to refresh.<BR/>
Enter 2 for frame 2, 3 for frame 3.<BR/><BR/>
<INPUT TYPE="Text" ID="Text1"><BR/>
<BUTTON ID="RefreshBtn">Refresh</BUTTON>
</BODY>
</HTML>
Frame2.htm
<HTML>
<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
MsgBox "Frame 2 is loading"
End Sub

Sub Window_onUnload
MsgBox "Frame 2 is unloading"
End Sub
</SCRIPT>
<BODY>
<H1>This is Frame 2</H1>
</BODY>
</HTML>
Frame3.htm
<HTML>
<SCRIPT LANGUAGE="VBScript">
Sub Window_onLoad
MsgBox "Frame 3 is loading"
End Sub

Sub Window_onUnload
MsgBox "Frame 3 is unloading"
End Sub
</SCRIPT>
<BODY>
<H1>This is Frame 3</H1>
</BODY>
</HTML>

monte96
May 3rd, 2001, 09:52 AM
You won't be able to do Response.Writes from one frame to the other because once the page is displayed, the server side processing is complete and everything is client side, but by giving each frame a unique name, you can update or change the page that is displayed in it. Which, again, JoshT showed above.

coox
May 3rd, 2001, 10:49 AM
Thanks for all your help everyone.

I've got one more question - Sundance, the code you posted works great, but I've got nested frames and can't seem to address the frame I want from the inner lot.

Is it something to do with "Top", and could you please explain what the Top keyword means in VBScript?

Sundance Kid
May 4th, 2001, 02:19 AM
I know my stuff:eek: ;) , but I can't explain myself to people sometimes. SO excuse me if I don't make sense.:confused:

You can get a handel on any frame in explorer. The TOP command is (like I understand) used for if you got you page inside a FRAMESET. Then you can use the TOP to access the other frames.

I Use the SET command allot with the frames. Example.

Set X = document.frames("IFrameName")

Then you can access all the properties and vbscript/javascript functions of the Iframename document.If you want the code I can Email or post it to you.

Post your code and I will see if I can be more specific and help you.

Is all your frames named different?

I hope I helped a little.

coox
May 4th, 2001, 06:37 AM
Hi Sundance. Thanks again for replying.

I have to say I hain't got a clue about that IFrameName thing.

Anyway, I've attached an example of what I'm trying to do - launch the one called OuterFrames.htm first. I'd like (for example) to update one of the inner frames (say TopRight) when the user clicks the button, but I can't figure out how to refer to it.

See what you can do anyway...

Sundance Kid
May 4th, 2001, 08:06 AM
Here is the answer. In Bottomright.html just this code (created an extra button named btn_test.

Sub btn_test_onclick()

Dim w

set w = parent.frames("TOPRIGHT")

w.location.href = "changed.htm"

End Sub

And voila (sp?).

My pleasure...

I will mail the files / upload but this is the only change.