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 Session variable from the frames page

Status
Not open for further replies.

netangel

Programmer
Feb 7, 2002
124
PT
Maybe I should place this post in HTML forum, but here it goes:

My ASPX pages are opened in a frames page. I want to have a url to that frames page (to open from other page or e-mail message) that forces some session variables to have certain values, in order to open the right pages inside the frames page.

This means that when I click a link to my page, I want it to be something like this:
w w w . m y s e r v e r . d e f a u l t . h t m <- this is my frames page
I want the Session(&quot;Action&quot;) to be set 'ListClients'. This session variable opens the ListClients.aspx page into the main frame of default.htm.

Even if I send querystring arguments, I can't reach them, as the htm page can't read them.

I really need the frames page to be opened with the right page.



NetAngel
 
It doesn't have to be html. I have a project that uses a dynamic frameset w/ an .asp page.

I have to tell you before you get going on this, though, that I HIGHLY recommend trying to avoid this technique, especially if the number and size of frames change based on criteria. Communicating between frames in a dynamic site is just more trouble than it's worth, it's a maintenance nightmare, and most times, you can achieve a very workable design w/o frame use.

That being said, this is what my frameset looks like on that page, which could easily be adapted to an .aspx page, rather than .asp.
Code:
<frameset rows=&quot;95,*,43&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;> 
<frame name=&quot;topFrame&quot; scrolling=&quot;NO&quot; noresize src=<%call determineTopSource%>>
<frame name=&quot;mainFrame&quot; src=&quot;choose.asp&quot;>
<frame name=&quot;bottomFrame&quot; scrolling=&quot;NO&quot; noresize src=<%call determineBottomSource%>>

so then you just declare the two subs, determineTopSource & determineBottomSource -- base those decisions off of your session variables, and return a string to the caller... ie. the name of the page to be loaded into that frame.

my main frame is actually redirected by that page, choose.asp -- it's a very complicated redirect routine, which is why I just decided to put it on another page... but you could use the same method for the main page that I used to determine the top & bottom if you wanted to.

hth! :)
paul
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top