Frameset URL of .htm page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a frameset 8-( (oohh no I hear u say - but stick with me), with 2 .aspx pages. For simplicity lets say

Main Page - Maintenance.ht
ASPX Top frame - Top.asp
ASPX Bottom frame - Bottom.asp

All I want to do is CAPTURE (in Top.aspx) the QueryString that is passed in Maintenance.htm. The main page will ALWAYS be passed with a QueryString (Maintenance.htm?Caller=12345, etc.). I need to get at the 12345 from my .aspx page(s)

A simple code sample would be appreciated (if possible) as it's due yesterday (as usual)
Regards, Tony
 
A few ways to go about it, but here's one: on load of top.aspx, get request.urlreferrer.query, which is the query fragment of the referring page (on the initial load, referring page for both top.aspx and bottom.aspx is maintenance.htm). In your case, the query should be "?Caller=12345". I presume you'll want to hang onto this somewhere, because if somebody other than maintenance.htm can load top.aspx into its frame, then you'd lose your value. ht

----- Tony wrote: ----

I have a frameset 8-( (oohh no I hear u say - but stick with me), with 2 .aspx pages. For simplicity lets say

Main Page - Maintenance.ht
ASPX Top frame - Top.asp
ASPX Bottom frame - Bottom.asp

All I want to do is CAPTURE (in Top.aspx) the QueryString that is passed in Maintenance.htm. The main page will ALWAYS be passed with a QueryString (Maintenance.htm?Caller=12345, etc.). I need to get at the 12345 from my .aspx page(s)

A simple code sample would be appreciated (if possible) as it's due yesterday (as usual)
Regards, Tony
 
If you want to do it client side you could parse the url of the frame
you want with a script like this:

function SomeScript()
{
var url=window.frames.top.location.href;
var query=url.split("?",2)[1];

if(query==null)
return;

var params=query.split("&");

for(var i=0; i<params.length; i++)
{
var param=params.split("=",2);
if(param[0]=="Caller")
{
//Do something
var value=param[1];
alert("Congratulations! You are " +
"caller number " + value);
}
}
}

/Hugo
 
THANKS to Bill and Hugo for their contribution.

Your comments are greatly appreciated - this is now RESOLVED.

For your info I used Bill's suggestion of Request.UrlReferrer.Query for simplicity.

Thanks again.
Tony
 
Back
Top