problem with iframes

  • Thread starter Thread starter Ashish
  • Start date Start date
A

Ashish

Incase the problem got bogged down reposting...

Hi Gregory,
I think I didnt make myself much clear. The problem is:

1. I have one ASP.NET application (no classic asp) and it has a main page
(i.e. kinda SDI main window)
that contains an IFrame.

2. I load different ASPX pages (that belong to the same ASP.NET project) in
that iframe.

3. The session variables are set by my business objects (again belong to the
same project).

4. The page that loads in the iframe tries to access the session object but
finds it null !!!

Thanks
Ashish
 
On the contrary if someone can tell me how to load aspx page dynamically (if
possible) in an IE multipage control it will eliminate the problem i think.
IFrames may be loading another appdomain while loading aspx pages.
Chao
Ashish
 
If the page you are loading in the IFRAME is part of the same web app, then
it should be able to share session variables with the main page with no
problem.
 
No infact when I try to access
System.Web.HttpContext.Current.Session from my child form it is getting null

I dont know whts missing here...

Ashish
 
I've done exactly what you are talking about without a problem. Perhaps you
are doing something non standard that is causing this behavior.
 
Well, I had always changed the 'src' attribute right on the client to set
the URL, but I don't see why it would matter.

Try loading your pages in a frameset and see if the same problem occurrs.

Also, is it possible that the main page has not yet set the session
variables, but the iframe has loaded and is looking for them?
 
ok i got it.. session wasnt initialized when i accessed it from page_load...
when does it actually gets created ?
Thanks
Ashish
 
You are being very vague, as you are not being specific about what page you
are talking about, or the flow of your program. The session is created on
the first request by a browser to the server. All subsequent requests from
iframes share that session. Everyone's page_load can access the session.

Basically, unless you want to post code and describe in more detail what you
are doing, it is impossible to say. All I can tell you, is that in general
this does work.
 
Back
Top