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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set the frame src using vbscript?

Status
Not open for further replies.

caconner

Technical User
May 20, 2002
42
US
I'm trying to set the source of one of my frames dynamically within the framset. I've created a function that determines the user and loads the leftFrame based upon the result. I'm not sure if something is wrong with my function or the manner in which I'm trying to call it from the frame src.

Any suggestions? TIA

<frameset cols=&quot;200,*&quot; rows=&quot;*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;>
<frame src=&quot;getLeftFrame(Request(&quot;leftFramePage&quot;))&quot; name=&quot;leftFrame&quot; scrolling=&quot;no noresize id=&quot;leftFrame&quot; >
<frameset rows=&quot;220,*&quot; cols=&quot;*&quot; framespacing=&quot;0&quot; frameborder=&quot;NO&quot; border=&quot;0&quot;>
<frame src=&quot;top.htm&quot; name=&quot;topFrame&quot; scrolling=&quot;no&quot; noresize id=&quot;topFrame&quot;>
<frame src=&quot;main.asp&quot; name=&quot;mainFrame&quot;>
</frameset>
</frameset><noframes></noframes>

<Script language=&quot;VBScript&quot;>

Function getLeftFrame(leftFramePage)

dim LogOn
LogOn = request.serverVariables(&quot;LOGON_USER&quot;)

if (len(LogOn) = 0) then
response.status = &quot;401 Authenticate&quot;
response.end
end if

dim objFSO
set objFSO = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)

if objFSO.FileExists (&quot;c:/inetpub/ then
dim objTextStream
set objTextStream = objFSO.OpenTextFile (&quot;c:/inetpub/ 1)

If LogOn = objTextStream.ReadLine then
LeftFramePage = &quot; end if

objTextStream.close
set objTextStream = Nothing
end if

Set objFSO = Nothing

</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top