|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
QueryString Problems
Hello!
I've made a website in asp. It has two frames, a menu and the main page. I have a variable in the menu page that is supposed to store the content of the QueryString from the address bar when the page is loaded. It doesn't work though! Is it actually possible for this to work, or am I just wasting my time with it?! Thanks for your help!
__________________
Support requests via PM will be ignored! |
|
#2
|
||||
|
||||
|
try setting the variable in the frame, i think with frames it acts as 2 different pages so you have to set it in the frame you are using it in. also you could try accessing it through the doc. obj. model, but i'm not sure if that would work.
|
|
#3
|
|||
|
|||
|
You could try passing the value through to the menu page in the URL like this:
Frameset Code:
<% @Language=VBScript %>
<% Option Explicit %>
<html>
<head><title>Test Frameset A</title></head>
<%
Dim sValue
sValue = CStr(Request.QueryString("Value"))
%>
<frameset cols="215, *">
<frame name="menu" frameborder="0" marginheight="10" marginwidth="10" noresize src="../asp/a_menu.asp?Value=<%=sValue%>">
<frame name="main" frameborder="0" marginheight="10" marginwidth="10" noresize src="../asp/a_main.asp">
</frameset>
</html>
Menu Code:
<% @language="VBScript" %>
<% Option Explicit %>
<html>
<head><title>Test Menu A</title></head>
<body bgcolor="#ffe0c0">
<basefont face="Arial Narrow, Arial, sans-serif">
<h2>This is the menu</h2>
<%
Dim sValue
sValue = Request.QueryString("Value")
Response.Write "Variable value is: " & sValue & "<br>"
%>
</body>
</html>
Main Page Code:
<% @Language=VBScript %> <% Option Explicit %> <html> <head><title>Test Main A</title></head> <body bgcolor="#ffe0c0"> <basefont face="Arial Narrow, Arial, sans-serif"> <h2>This is the main page</h2> </body> </html> or you could use a session variable like this: Frameset Code:
<% @Language=VBScript %>
<% Option Explicit %>
<html>
<head><title>Test Frameset B</title></head>
<%
Session("Value") = CStr(Request.QueryString("Value"))
%>
<frameset cols="215, *">
<frame name="menu" frameborder="0" marginheight="10" marginwidth="10" noresize src="../asp/b_menu.asp">
<frame name="main" frameborder="0" marginheight="10" marginwidth="10" noresize src="../asp/b_main.asp">
</frameset>
</html>
Menu Code:
<% @language="VBScript" %>
<% Option Explicit %>
<html>
<head><title>Test Menu</title></head>
<body bgcolor="#ffe0c0">
<basefont face="Arial Narrow, Arial, sans-serif">
<h2>This is the menu</h2>
<%
Response.Write "Variable value is: " & Session("Value") & "<br>"
%>
</body>
</html>
Main Page Code:
<% @Language=VBScript %> <% Option Explicit %> <html> <head><title>Test Main B</title></head> <body bgcolor="#ffe0c0"> <basefont face="Arial Narrow, Arial, sans-serif"> <h2>This is the main page</h2> </body> </html> Hope this helps! Simon. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > QueryString Problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|