problem with iframes

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
 
A

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
 
M

Marina

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.
 
A

Ashish

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
 
M

Marina

I've done exactly what you are talking about without a problem. Perhaps you
are doing something non standard that is causing this behavior.
 
M

Marina

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?
 
A

Ashish

ok i got it.. session wasnt initialized when i accessed it from page_load...
when does it actually gets created ?
Thanks
Ashish
 
M

Marina

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top