473,832 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IFRAME session timeout trap error question

In javascript code on MyPage.aspx, I set a hidden IFRAME's source url:

myframe.locatio n.href = 'someotherpage. aspx';

If the session has timed out, preventing someotherpage.a spx from being
loaded into the IFRAME, where can that error condition be trapped?
Thanks
Timo
Nov 19 '05 #1
3 9568
Making any kind of request through the frame would re-establish a timed out
session.......I 'll assume here there are values that have been set that make
the session invalid, whihc is whay your looking for some form of solution.
So, then it depends on how you handle the page server side, and how you
process the results. You can trap it server side using a generic error
handler in your asp.net code, as described here:

http://www.15seconds.com/issue/030102.htm

and then evaluate what returned with javascript if you need to, and for some
reason cant display an actual message in the frame.

http://www.faqts.com/knowledge_base/...d/9967/fid/129

or you could use remote scripting to check if the session is still active
before you make any requests

http://www.oreillynet.com/pub/a/java...08/iframe.html

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Timo" <Ti**@somewhere lese.com> wrote in message
news:eW******** ******@TK2MSFTN GP15.phx.gbl...
In javascript code on MyPage.aspx, I set a hidden IFRAME's source url:

myframe.locatio n.href = 'someotherpage. aspx';

If the session has timed out, preventing someotherpage.a spx from being
loaded into the IFRAME, where can that error condition be trapped?
Thanks
Timo

Nov 19 '05 #2
John,
I've narrowed down the problem: Response.Redire ct(...) does not seem to do
anything when invoked in the Page_Load eventhandler of an aspx page which
has been loaded into an IFRAME.

1. Mypage.aspx contains a hidden IFRAME which is used as an alternative to
XMLHttp to fetch data from a database without a postback
2. Javascript on mypage.aspx sets the IFRAME's url. For example:
myframe.locatio n.href = 'fetchdata.aspx ';
This works OK.
3. fetchdata.aspx in its Page_Load() looks to see if there's a valid session
(the session may have timed out); if the session has expired, we try to
redirect to Logon.aspx:
Response.Redire ct("Logon.aspx" )

But this does not work. I've stepped through the code, and although the
Response.Redire ct("Logon.aspx" ) line does get executed, it has no effect. So
the problem is, mypage.aspx, expecting to get data back from fetchdata.aspx,
instead gets nothing and just sits there. So I need a way for
fetchdata.aspx (in the IFRAME) to tell its parent document (mypage.aspx)
that the session has timed out. I suppose fetchdata.aspx could write some
dynamic javascript that invokes a function in mypage.asxp, but I was hoping
for something more elegant.

Is this IFRAME Page_Load Response.Redire ct do-nothingness by design?
Timo

"John Timney (ASP.NET MVP)" <ti*****@despam med.com> wrote in message
news:On******** ******@TK2MSFTN GP09.phx.gbl...
Making any kind of request through the frame would re-establish a timed out session.......I 'll assume here there are values that have been set that make the session invalid, whihc is whay your looking for some form of solution.
So, then it depends on how you handle the page server side, and how you
process the results. You can trap it server side using a generic error
handler in your asp.net code, as described here:

http://www.15seconds.com/issue/030102.htm

and then evaluate what returned with javascript if you need to, and for some reason cant display an actual message in the frame.

http://www.faqts.com/knowledge_base/...d/9967/fid/129

or you could use remote scripting to check if the session is still active
before you make any requests

http://www.oreillynet.com/pub/a/java...08/iframe.html

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Timo" <Ti**@somewhere lese.com> wrote in message
news:eW******** ******@TK2MSFTN GP15.phx.gbl...
In javascript code on MyPage.aspx, I set a hidden IFRAME's source url:

myframe.locatio n.href = 'someotherpage. aspx';

If the session has timed out, preventing someotherpage.a spx from being
loaded into the IFRAME, where can that error condition be trapped?
Thanks
Timo


Nov 19 '05 #3
the iframe redirect works fine. if you looked in the iframe you'd see the
login page. server redirects do not support specifing the window (target).
you need to fall back to client script.

-- bruce (sqlwork.com)
"Timo" <ti**@somewhere else.com> wrote in message
news:uo******** *****@tk2msftng p13.phx.gbl...
| John,
| I've narrowed down the problem: Response.Redire ct(...) does not seem to do
| anything when invoked in the Page_Load eventhandler of an aspx page which
| has been loaded into an IFRAME.
|
| 1. Mypage.aspx contains a hidden IFRAME which is used as an alternative
to
| XMLHttp to fetch data from a database without a postback
| 2. Javascript on mypage.aspx sets the IFRAME's url. For example:
| myframe.locatio n.href = 'fetchdata.aspx ';
| This works OK.
| 3. fetchdata.aspx in its Page_Load() looks to see if there's a valid
session
| (the session may have timed out); if the session has expired, we try to
| redirect to Logon.aspx:
| Response.Redire ct("Logon.aspx" )
|
| But this does not work. I've stepped through the code, and although the
| Response.Redire ct("Logon.aspx" ) line does get executed, it has no effect.
So
| the problem is, mypage.aspx, expecting to get data back from
fetchdata.aspx,
| instead gets nothing and just sits there. So I need a way for
| fetchdata.aspx (in the IFRAME) to tell its parent document (mypage.aspx)
| that the session has timed out. I suppose fetchdata.aspx could write some
| dynamic javascript that invokes a function in mypage.asxp, but I was
hoping
| for something more elegant.
|
| Is this IFRAME Page_Load Response.Redire ct do-nothingness by design?
| Timo
|
| "John Timney (ASP.NET MVP)" <ti*****@despam med.com> wrote in message
| news:On******** ******@TK2MSFTN GP09.phx.gbl...
| > Making any kind of request through the frame would re-establish a timed
| out
| > session.......I 'll assume here there are values that have been set that
| make
| > the session invalid, whihc is whay your looking for some form of
solution.
| > So, then it depends on how you handle the page server side, and how you
| > process the results. You can trap it server side using a generic error
| > handler in your asp.net code, as described here:
| >
| > http://www.15seconds.com/issue/030102.htm
| >
| > and then evaluate what returned with javascript if you need to, and for
| some
| > reason cant display an actual message in the frame.
| >
| > http://www.faqts.com/knowledge_base/...d/9967/fid/129
| >
| > or you could use remote scripting to check if the session is still
active
| > before you make any requests
| >
| > http://www.oreillynet.com/pub/a/java...08/iframe.html
| >
| > --
| > Regards
| >
| > John Timney
| > ASP.NET MVP
| > Microsoft Regional Director
| >
| > "Timo" <Ti**@somewhere lese.com> wrote in message
| > news:eW******** ******@TK2MSFTN GP15.phx.gbl...
| > > In javascript code on MyPage.aspx, I set a hidden IFRAME's source url:
| > >
| > > myframe.locatio n.href = 'someotherpage. aspx';
| > >
| > > If the session has timed out, preventing someotherpage.a spx from being
| > > loaded into the IFRAME, where can that error condition be trapped?
| > > Thanks
| > > Timo
| > >
| > >
| >
| >
|
|
Nov 19 '05 #4

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

Similar topics

14
4079
by: Darrin J Olson | last post by:
I am trying to end a session for a site without having to completely close the browser to end it. When I access the site and log in it works fine. If I log out and in with a different account without closing the browser, I get the first session's information. Also, if a open another browser and log in with a different account I get the session from the first browser. I've tried deleting all cookies and any cached pages, but still get the...
4
4189
by: Jack | last post by:
Hi, I was wondering if for an application, I can change the default session timeout property via IIS Administration? If so, how does one do it. Thanks in advance.
3
7742
by: charliewest | last post by:
Hi - I'm trying to control the error that is thrown when the session times out. My code is as follows: <customErrors mode="RemoteOnly"> <error redirect="includes/reload.aspx?iOP=1" statusCode="Timeout" />
1
2810
by: kambakht | last post by:
I am using an iframe in my index.aspx thus all the webforms in application navigate in this iframe. While main appication links are present on the top of page above iframe, in main window. These links have target=myiFrame, thus opening respective pages in iFrame. I have put the session timeout period on each page so if some user remains inactive for 10 minutes (all webforms in iframe), he will be redirected to login.aspx page through...
1
8117
by: kambakht | last post by:
I am using an iframe in my index.aspx thus all the webforms in application navigate in this iframe. While main appication links are present on the top of page above iframe, in main window. These links have target=myiFrame, thus opening respective pages in iFrame. I have put the session timeout period on each page so if some user remains inactive for 10 minutes (all webforms in iframe), he will be redirected to login.aspx page through...
13
2984
by: =?Utf-8?B?ZG91Zw==?= | last post by:
I support several intranet sites one of which had NO STATE. Even though content has ASP extensions, it was all rendered HTML. Site had NO session or application variables being managed. Site had no global.asa. IIS Manager had site timeout set to 20 minutes. We had to add an ASP include to pages, and that ASP include contained our first session variable. Users then started complaining of timeouts and being redirected to logout pages...
3
590
by: trullock | last post by:
Hi, I want to test some session timeout code ive written but im getting a few problems. I want to reduce the session timeout to 1min so i dont have to wait around for 20 min to see if my code is working. Quite simply, how do i do this? I want the session to behave exactly as it does normally (is that
3
2117
by: dmalhotr | last post by:
Hi, I would like to know if there was a way to trap a session timeout on an asp.net event. What I mean is that I've set a session timeout in the web.config file. What I would like to do is when that timeout is reached, I would like it to fire an event. Is there some event in the global asax that could fire when the session normally ends. I need to capture this to call a corresponding function during time lapse timeout.
6
3786
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart editing processes place a very heavy load on the server as the effects of the edit ripple through the organisation structure, requiring potentially large numbers of rows in one of the tables to be updated. (I have done it this way to make the more...
0
9795
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10780
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4421
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.