473,378 Members | 1,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

problem with iframes

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

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:Ou**************@TK2MSFTNGP11.phx.gbl...
Pages in IFrame in the same app? If the IFrame pages come from another app, you will not share session unless you have the keys set identically and, if using forms auth, have the same forms auth cookie name. Best to put the ASPX pages in the same app.

Is the IFrame on page1 of the app? The firing of events may be the problem. As a cheap way of setting this, you can have the first page create any
session objects and redirect to the IFRAME holding page.

One more question? The page in the IFRAME is ASPX, is the page outside of
the IFRAME ASP or ASPX? If ASP, they have different sessions. There is an
article on MSDN.microsoft.com that tells how to share session in ASP and
ASPX:
http://msdn.microsoft.com/library/en...rttoaspnet.asp

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Ashish" <no****@myself.com> wrote in message
news:uG**************@TK2MSFTNGP10.phx.gbl...
Hi All,
I have a main page that contains an iframe. Depending upon tab control
selection, I load several different aspx pages (from the same app) to the iframe. My parent sets data in the session variable. The page in the

iframe
is unable to access the session object (shows null). My guess is that the dll is loaded twice as asp.net loads another instance of dll in the

iframe.
Interestingly in another scenerio I am playing with modal dialogs and set data in session object and upon closing modal dialog my parent ie window
gets the data. I load the page in the modal dialog via javascript. In this case why doesnt asp.net load another instance of dll ? Any way to get

around
the iframe problem?
Thanks
Ashish



Nov 18 '05 #1
8 3335
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

"Ashish" <no****@myself.com> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
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

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:Ou**************@TK2MSFTNGP11.phx.gbl...
Pages in IFrame in the same app? If the IFrame pages come from another

app,
you will not share session unless you have the keys set identically and,

if
using forms auth, have the same forms auth cookie name. Best to put the

ASPX
pages in the same app.

Is the IFrame on page1 of the app? The firing of events may be the

problem.
As a cheap way of setting this, you can have the first page create any
session objects and redirect to the IFRAME holding page.

One more question? The page in the IFRAME is ASPX, is the page outside of
the IFRAME ASP or ASPX? If ASP, they have different sessions. There is an article on MSDN.microsoft.com that tells how to share session in ASP and
ASPX:
http://msdn.microsoft.com/library/en...rttoaspnet.asp

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Ashish" <no****@myself.com> wrote in message
news:uG**************@TK2MSFTNGP10.phx.gbl...
Hi All,
I have a main page that contains an iframe. Depending upon tab control
selection, I load several different aspx pages (from the same app) to

the iframe. My parent sets data in the session variable. The page in the

iframe
is unable to access the session object (shows null). My guess is that the dll is loaded twice as asp.net loads another instance of dll in the

iframe.
Interestingly in another scenerio I am playing with modal dialogs and set data in session object and upon closing modal dialog my parent ie window gets the data. I load the page in the modal dialog via javascript. In this case why doesnt asp.net load another instance of dll ? Any way to get

around
the iframe problem?
Thanks
Ashish



Nov 18 '05 #2
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.

"Ashish" <no****@myself.com> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
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

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:Ou**************@TK2MSFTNGP11.phx.gbl...
Pages in IFrame in the same app? If the IFrame pages come from another

app,
you will not share session unless you have the keys set identically and,

if
using forms auth, have the same forms auth cookie name. Best to put the

ASPX
pages in the same app.

Is the IFrame on page1 of the app? The firing of events may be the

problem.
As a cheap way of setting this, you can have the first page create any
session objects and redirect to the IFRAME holding page.

One more question? The page in the IFRAME is ASPX, is the page outside of
the IFRAME ASP or ASPX? If ASP, they have different sessions. There is an article on MSDN.microsoft.com that tells how to share session in ASP and
ASPX:
http://msdn.microsoft.com/library/en...rttoaspnet.asp

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Ashish" <no****@myself.com> wrote in message
news:uG**************@TK2MSFTNGP10.phx.gbl...
Hi All,
I have a main page that contains an iframe. Depending upon tab control
selection, I load several different aspx pages (from the same app) to

the iframe. My parent sets data in the session variable. The page in the

iframe
is unable to access the session object (shows null). My guess is that the dll is loaded twice as asp.net loads another instance of dll in the

iframe.
Interestingly in another scenerio I am playing with modal dialogs and set data in session object and upon closing modal dialog my parent ie window gets the data. I load the page in the modal dialog via javascript. In this case why doesnt asp.net load another instance of dll ? Any way to get

around
the iframe problem?
Thanks
Ashish



Nov 18 '05 #3
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

"Marina" <so*****@nospam.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
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.

"Ashish" <no****@myself.com> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
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

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in message news:Ou**************@TK2MSFTNGP11.phx.gbl...
Pages in IFrame in the same app? If the IFrame pages come from another

app,
you will not share session unless you have the keys set identically and,
if
using forms auth, have the same forms auth cookie name. Best to put
the ASPX
pages in the same app.

Is the IFrame on page1 of the app? The firing of events may be the

problem.
As a cheap way of setting this, you can have the first page create any
session objects and redirect to the IFRAME holding page.

One more question? The page in the IFRAME is ASPX, is the page outside of the IFRAME ASP or ASPX? If ASP, they have different sessions. There is an article on MSDN.microsoft.com that tells how to share session in ASP
and ASPX:
http://msdn.microsoft.com/library/en...rttoaspnet.asp
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Ashish" <no****@myself.com> wrote in message
news:uG**************@TK2MSFTNGP10.phx.gbl...
> Hi All,
> I have a main page that contains an iframe. Depending upon tab control > selection, I load several different aspx pages (from the same app) to the
> iframe. My parent sets data in the session variable. The page in the
iframe
> is unable to access the session object (shows null). My guess is
that the
> dll is loaded twice as asp.net loads another instance of dll in the
iframe.
> Interestingly in another scenerio I am playing with modal dialogs
and set
> data in session object and upon closing modal dialog my parent ie window > gets the data. I load the page in the modal dialog via javascript.

In this
> case why doesnt asp.net load another instance of dll ? Any way to

get around
> the iframe problem?
> Thanks
> Ashish
>
>



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

"Ashish" <no****@myself.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...
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

"Marina" <so*****@nospam.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
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.

"Ashish" <no****@myself.com> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
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

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in message news:Ou**************@TK2MSFTNGP11.phx.gbl...
> Pages in IFrame in the same app? If the IFrame pages come from
another app,
> you will not share session unless you have the keys set identically

and, if
> using forms auth, have the same forms auth cookie name. Best to put the ASPX
> pages in the same app.
>
> Is the IFrame on page1 of the app? The firing of events may be the
problem.
> As a cheap way of setting this, you can have the first page create any > session objects and redirect to the IFRAME holding page.
>
> One more question? The page in the IFRAME is ASPX, is the page outside of
> the IFRAME ASP or ASPX? If ASP, they have different sessions. There
is
an
> article on MSDN.microsoft.com that tells how to share session in ASP

and > ASPX:
> http://msdn.microsoft.com/library/en...rttoaspnet.asp >
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
>
************************************************** ******************** > Think Outside the Box!
> ************************************************** ******************** > "Ashish" <no****@myself.com> wrote in message
> news:uG**************@TK2MSFTNGP10.phx.gbl...
> > Hi All,
> > I have a main page that contains an iframe. Depending upon tab

control > > selection, I load several different aspx pages (from the same app) to the
> > iframe. My parent sets data in the session variable. The page in the > iframe
> > is unable to access the session object (shows null). My guess is that the
> > dll is loaded twice as asp.net loads another instance of dll in the > iframe.
> > Interestingly in another scenerio I am playing with modal dialogs and set
> > data in session object and upon closing modal dialog my parent ie

window
> > gets the data. I load the page in the modal dialog via javascript. In this
> > case why doesnt asp.net load another instance of dll ? Any way to get > around
> > the iframe problem?
> > Thanks
> > Ashish
> >
> >
>
>



Nov 18 '05 #5
Are you calling iframe.Attributes.add to change the url ?
Thanks
Ashish

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I've done exactly what you are talking about without a problem. Perhaps you are doing something non standard that is causing this behavior.

"Ashish" <no****@myself.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...
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

"Marina" <so*****@nospam.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
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.

"Ashish" <no****@myself.com> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
> 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
>
> "Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM>
wrote
in
> message news:Ou**************@TK2MSFTNGP11.phx.gbl...
> > Pages in IFrame in the same app? If the IFrame pages come from another > app,
> > you will not share session unless you have the keys set
identically and,
> if
> > using forms auth, have the same forms auth cookie name. Best to
put the
> ASPX
> > pages in the same app.
> >
> > Is the IFrame on page1 of the app? The firing of events may be the
> problem.
> > As a cheap way of setting this, you can have the first page create any > > session objects and redirect to the IFRAME holding page.
> >
> > One more question? The page in the IFRAME is ASPX, is the page outside of
> > the IFRAME ASP or ASPX? If ASP, they have different sessions.
There
is an
> > article on MSDN.microsoft.com that tells how to share session in
ASP and
> > ASPX:
> >

http://msdn.microsoft.com/library/en...rttoaspnet.asp
> >
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> >
> > ************************************************** ******************** > > Think Outside the Box!
> > ************************************************** ******************** > > "Ashish" <no****@myself.com> wrote in message
> > news:uG**************@TK2MSFTNGP10.phx.gbl...
> > > Hi All,
> > > I have a main page that contains an iframe. Depending upon tab

control
> > > selection, I load several different aspx pages (from the same
app) to
> the
> > > iframe. My parent sets data in the session variable. The page in the > > iframe
> > > is unable to access the session object (shows null). My guess is

that
> the
> > > dll is loaded twice as asp.net loads another instance of dll in the > > iframe.
> > > Interestingly in another scenerio I am playing with modal

dialogs and
> set
> > > data in session object and upon closing modal dialog my parent
ie window
> > > gets the data. I load the page in the modal dialog via

javascript. In
> this
> > > case why doesnt asp.net load another instance of dll ? Any way
to get
> > around
> > > the iframe problem?
> > > Thanks
> > > Ashish
> > >
> > >
> >
> >
>
>
>



Nov 18 '05 #6
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?

"Ashish" <no****@myself.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
Are you calling iframe.Attributes.add to change the url ?
Thanks
Ashish

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I've done exactly what you are talking about without a problem. Perhaps

you
are doing something non standard that is causing this behavior.

"Ashish" <no****@myself.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...
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

"Marina" <so*****@nospam.com> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
> 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.
>
> "Ashish" <no****@myself.com> wrote in message
> news:uw**************@tk2msftngp13.phx.gbl...
> > 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
> >
> > "Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM>

wrote in
> > message news:Ou**************@TK2MSFTNGP11.phx.gbl...
> > > Pages in IFrame in the same app? If the IFrame pages come from

another
> > app,
> > > you will not share session unless you have the keys set identically and,
> > if
> > > using forms auth, have the same forms auth cookie name. Best to put the
> > ASPX
> > > pages in the same app.
> > >
> > > Is the IFrame on page1 of the app? The firing of events may be the > > problem.
> > > As a cheap way of setting this, you can have the first page create any
> > > session objects and redirect to the IFRAME holding page.
> > >
> > > One more question? The page in the IFRAME is ASPX, is the page

outside
> of
> > > the IFRAME ASP or ASPX? If ASP, they have different sessions. There
is
> an
> > > article on MSDN.microsoft.com that tells how to share session in ASP and
> > > ASPX:
> > >
http://msdn.microsoft.com/library/en...rttoaspnet.asp > > >
> > > --
> > > Gregory A. Beamer
> > > MVP; MCP: +I, SE, SD, DBA
> > >
> > >

************************************************** ********************
> > > Think Outside the Box!
> > >

************************************************** ********************
> > > "Ashish" <no****@myself.com> wrote in message
> > > news:uG**************@TK2MSFTNGP10.phx.gbl...
> > > > Hi All,
> > > > I have a main page that contains an iframe. Depending upon tab
control
> > > > selection, I load several different aspx pages (from the same

app) to
> > the
> > > > iframe. My parent sets data in the session variable. The page in the
> > > iframe
> > > > is unable to access the session object (shows null). My guess
is that
> > the
> > > > dll is loaded twice as asp.net loads another instance of dll
in the
> > > iframe.
> > > > Interestingly in another scenerio I am playing with modal

dialogs and
> > set
> > > > data in session object and upon closing modal dialog my parent ie > window
> > > > gets the data. I load the page in the modal dialog via javascript. In
> > this
> > > > case why doesnt asp.net load another instance of dll ? Any way to get
> > > around
> > > > the iframe problem?
> > > > Thanks
> > > > Ashish
> > > >
> > > >
> > >
> > >
> >
> >
> >
>
>



Nov 18 '05 #7
ok i got it.. session wasnt initialized when i accessed it from page_load...
when does it actually gets created ?
Thanks
Ashish
"Marina" <so*****@nospam.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
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?

"Ashish" <no****@myself.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
Are you calling iframe.Attributes.add to change the url ?
Thanks
Ashish

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I've done exactly what you are talking about without a problem. Perhaps
you
are doing something non standard that is causing this behavior.

"Ashish" <no****@myself.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...
> 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
>
> "Marina" <so*****@nospam.com> wrote in message
> news:uW**************@TK2MSFTNGP12.phx.gbl...
> > 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.
> >
> > "Ashish" <no****@myself.com> wrote in message
> > news:uw**************@tk2msftngp13.phx.gbl...
> > > 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
> > >
> > > "Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM>

wrote
> in
> > > message news:Ou**************@TK2MSFTNGP11.phx.gbl...
> > > > Pages in IFrame in the same app? If the IFrame pages come from
another
> > > app,
> > > > you will not share session unless you have the keys set

identically
> and,
> > > if
> > > > using forms auth, have the same forms auth cookie name. Best
to put
> the
> > > ASPX
> > > > pages in the same app.
> > > >
> > > > Is the IFrame on page1 of the app? The firing of events may be the > > > problem.
> > > > As a cheap way of setting this, you can have the first page create any
> > > > session objects and redirect to the IFRAME holding page.
> > > >
> > > > One more question? The page in the IFRAME is ASPX, is the page
outside
> > of
> > > > the IFRAME ASP or ASPX? If ASP, they have different sessions.

There
is
> > an
> > > > article on MSDN.microsoft.com that tells how to share session
in ASP
> and
> > > > ASPX:
> > > >
> http://msdn.microsoft.com/library/en...rttoaspnet.asp > > > >
> > > > --
> > > > Gregory A. Beamer
> > > > MVP; MCP: +I, SE, SD, DBA
> > > >
> > > >
************************************************** ********************
> > > > Think Outside the Box!
> > > >
************************************************** ********************
> > > > "Ashish" <no****@myself.com> wrote in message
> > > > news:uG**************@TK2MSFTNGP10.phx.gbl...
> > > > > Hi All,
> > > > > I have a main page that contains an iframe. Depending upon
tab > control
> > > > > selection, I load several different aspx pages (from the

same app)
> to
> > > the
> > > > > iframe. My parent sets data in the session variable. The
page in the
> > > > iframe
> > > > > is unable to access the session object (shows null). My
guess
is > that
> > > the
> > > > > dll is loaded twice as asp.net loads another instance of dll in the
> > > > iframe.
> > > > > Interestingly in another scenerio I am playing with modal

dialogs
> and
> > > set
> > > > > data in session object and upon closing modal dialog my

parent ie
> > window
> > > > > gets the data. I load the page in the modal dialog via

javascript.
> In
> > > this
> > > > > case why doesnt asp.net load another instance of dll ? Any
way to
> get
> > > > around
> > > > > the iframe problem?
> > > > > Thanks
> > > > > Ashish
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #8
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.

"Ashish" <no****@myself.com> wrote in message
news:OU*************@TK2MSFTNGP12.phx.gbl...
ok i got it.. session wasnt initialized when i accessed it from page_load... when does it actually gets created ?
Thanks
Ashish
"Marina" <so*****@nospam.com> wrote in message
news:e2**************@tk2msftngp13.phx.gbl...
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?

"Ashish" <no****@myself.com> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
Are you calling iframe.Attributes.add to change the url ?
Thanks
Ashish

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
> I've done exactly what you are talking about without a problem. Perhaps you
> are doing something non standard that is causing this behavior.
>
> "Ashish" <no****@myself.com> wrote in message
> news:ef**************@TK2MSFTNGP10.phx.gbl...
> > 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
> >
> > "Marina" <so*****@nospam.com> wrote in message
> > news:uW**************@TK2MSFTNGP12.phx.gbl...
> > > 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.
> > >
> > > "Ashish" <no****@myself.com> wrote in message
> > > news:uw**************@tk2msftngp13.phx.gbl...
> > > > 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
> > > >
> > > > "Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote
> > in
> > > > message news:Ou**************@TK2MSFTNGP11.phx.gbl...
> > > > > Pages in IFrame in the same app? If the IFrame pages come from > another
> > > > app,
> > > > > you will not share session unless you have the keys set
identically
> > and,
> > > > if
> > > > > using forms auth, have the same forms auth cookie name. Best

to put
> > the
> > > > ASPX
> > > > > pages in the same app.
> > > > >
> > > > > Is the IFrame on page1 of the app? The firing of events may be the
> > > > problem.
> > > > > As a cheap way of setting this, you can have the first page

create
> any
> > > > > session objects and redirect to the IFRAME holding page.
> > > > >
> > > > > One more question? The page in the IFRAME is ASPX, is the
page > outside
> > > of
> > > > > the IFRAME ASP or ASPX? If ASP, they have different sessions. There
> is
> > > an
> > > > > article on MSDN.microsoft.com that tells how to share session in ASP
> > and
> > > > > ASPX:
> > > > >
> >

http://msdn.microsoft.com/library/en...rttoaspnet.asp
> > > > >
> > > > > --
> > > > > Gregory A. Beamer
> > > > > MVP; MCP: +I, SE, SD, DBA
> > > > >
> > > > >
>
************************************************** ******************** > > > > > Think Outside the Box!
> > > > >
> ************************************************** ******************** > > > > > "Ashish" <no****@myself.com> wrote in message
> > > > > news:uG**************@TK2MSFTNGP10.phx.gbl...
> > > > > > Hi All,
> > > > > > I have a main page that contains an iframe. Depending upon tab > > control
> > > > > > selection, I load several different aspx pages (from the same app)
> > to
> > > > the
> > > > > > iframe. My parent sets data in the session variable. The page
in
> the
> > > > > iframe
> > > > > > is unable to access the session object (shows null). My

guess
is
> > that
> > > > the
> > > > > > dll is loaded twice as asp.net loads another instance of

dll in
> the
> > > > > iframe.
> > > > > > Interestingly in another scenerio I am playing with modal
dialogs
> > and
> > > > set
> > > > > > data in session object and upon closing modal dialog my

parent ie
> > > window
> > > > > > gets the data. I load the page in the modal dialog via
javascript.
> > In
> > > > this
> > > > > > case why doesnt asp.net load another instance of dll ? Any way to
> > get
> > > > > around
> > > > > > the iframe problem?
> > > > > > Thanks
> > > > > > Ashish
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: maxim vexler | last post by:
I'm reading a lot of talks lately about the term iFrame and with your permission would like to ask a few question about that : - what is iFrame, i mean what is it good for ? - does all the...
1
by: Koms Bomb | last post by:
I create two iframes dynamically to get data from the server. I want to deal with the data after it's downloaded, so I set the two iframes' onload event handlers to current document(not the iframe...
17
by: Bruce W...1 | last post by:
I don't seem to be getting anywhere with trying to make my web page transitional XHTML. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
6
by: mike | last post by:
I have a page that uses a some javascript and it works fine in IE but fails to work in Firefox. Basically what I'm trying to do is have 3 iframes on a page but only displaying one of them at a...
2
by: Guadala Harry | last post by:
1. Are IFrames supported only in uplevel versions of IE? If not IE exclusively, what browsers support IFrames? 2. Are IFrames going to be supported in the future - as far as anyone knows - or...
7
by: Oleg | last post by:
I have a web form let's say 'YYZ.aspx'. It has an iframe in it. When it loads it shows progress bar in IE this way: loading for page then again loading for page in iframe. This part is fine....
3
by: Giggle Girl | last post by:
Is there a way to use Javascript to detect if a browser supports IFrames, or (if it DOES support them) that IFrame use is enabled? Thanks, Ann
2
by: ericisjusteric | last post by:
I have a page with multiple iframes and need to have the user (ie6) be able to click a button to refresh any one of the iframes - but also to click another button at the top of the page to refresh...
1
by: enthusiastic | last post by:
Hi All I have a HTML page where I dynamically created 2 Iframes. The problem is, after this page is loaded & I navigate to some other page & come back using browsers back button, both of the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.