473,790 Members | 3,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling application error in asp.net

Hello,

I am new to asp.net. when i close the browser programmaticall y I
am getting an application error at the line given below.

<param name="SessionID " value="<%= Session["SessionID"] %>"/>

because of the session no more exists. Can anybody please tell me how
to handle that error.

Thanks in advance.

Regards,
Gouri.
Jun 27 '08 #1
7 1185
I'm not sure how you can process a request if the browser is closed. You
perhaps explicitely called Session.Abandon ???

Some more details about the context could help. What are yoou doing before
being at this point ?

--
Patrice

<Go************ @gmail.coma écrit dans le message de groupe de discussion :
0d************* *************** **...legroup s.com...
Hello,

I am new to asp.net. when i close the browser programmaticall y I
am getting an application error at the line given below.

<param name="SessionID " value="<%= Session["SessionID"] %>"/>

because of the session no more exists. Can anybody please tell me how
to handle that error.

Thanks in advance.

Regards,
Gouri.

Jun 27 '08 #2
On May 22, 1:43*pm, "Patrice" <http://www.chez.com/scribe/wrote:
I'm not sure how you can process a request if the browser is closed. You
perhaps explicitely called Session.Abandon ???

Some more details about the context could help. What are yoou doing before
being at this point ?

--
Patrice

<Gouri.Mahaj... @gmail.coma écrit dans le message de groupe de discussion :
0d6b83a9-e3ec-4d9a-b832-a9703dc08...@i3 6g2000prf.googl egroups.com...
Hello,
* * I am new to asp.net. when i close the browser programmaticall y I
am getting an application error at the line given below.
* *<param name="SessionID " value="<%= Session["SessionID"] %>"/>
because of the session no more exists. Can anybody please tell me how
to handle that error.
Thanks in advance.
Regards,
Gouri.- Hide quoted text -

- Show quoted text -
Actually I am loading the user control on the browser and passing the
session Id of the page as the parameter to the user control. When
disconnect button on my web page is clicked I am calling
session.abandon method and closing the browser using java script.
After that the control is passed to the line which I have mentioned
earlier (During execution) in that case the session is no more
exists. So I am getting an error to that line. Can you please tell me
how to handle that error not to occur.

Thanks.
Jun 27 '08 #3
Actually I am loading the user control on the browser and passing the
session Id of the page as the parameter to the user control. When
disconnect button on my web page is clicked I am calling
session.abandon method and closing the browser using java script.
After that the control is passed to the line which I have mentioned
earlier (During execution) in that case the session is no more
exists. So I am getting an error to that line. Can you please tell me
how to handle that error not to occur.
Do you really need to get at this line ? If yes, you could just have a fflag
to know the user asked for abandon but do the call at the very last steps in
your code. Anotehr optino if you don"t know to get at this line would be to
stop the request right after the abandon (request.end) or have a special
page handling this rather than trying to do that in a page that sometimes
requires a session.

Also I'm surprised closing the browser using javascript works. It should at
least ask a question to the user. Finally it could be not that a smart
optino (for example one could close the session and use the window for
something else...)

---
Patrice.

Jun 27 '08 #4
"Patrice" <http://www.chez.com/scribe/wrote in message
news:5F******** *************** ***********@mic rosoft.com...
Also I'm surprised closing the browser using JavaScript works. It should
at least ask a question to the user.
Not if you include

window.opener=n ull;

before

window.close();
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #5
On May 22, 3:50*pm, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:
"Patrice" <http://www.chez.com/scribe/wrote in message

news:5F******** *************** ***********@mic rosoft.com...
Also I'm surprised closing the browser using JavaScript works. It should
at least ask a question to the user.

Not if you include

window.opener=n ull;

before

window.close();

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Hello,

Still it is giving an error. Can you please tell me other otions.
Jun 27 '08 #6
<Go************ @gmail.comwrote in message
news:b7******** *************** ***********@v26 g2000prm.google groups.com...
>>Also I'm surprised closing the browser using JavaScript works. It should
at least ask a question to the user.

Not if you include

window.opener= null;

before

window.close() ;

Still it is giving an error. Can you please tell me other otions.
The above will not fix your Session problem - it is designed to prevent a
browser asking for confirmation of closing...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #7
re:
!When disconnect button on my web page is clicked I am calling
!session.abando n method and closing the browser using java script.
!After that the control is passed to the line which I have mentioned
!earlier (During execution) in that case the session is no more
!exists. So I am getting an error to that line. Can you please tell me
!how to handle that error not to occur.

You will have to execute that line before calling Session.Abandon .

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
<Go************ @gmail.comwrote in message news:38******** *************** ***********@w8g 2000prd.googleg roups.com...
On May 22, 1:43 pm, "Patrice" <http://www.chez.com/scribe/wrote:
I'm not sure how you can process a request if the browser is closed. You
perhaps explicitely called Session.Abandon ???

Some more details about the context could help. What are yoou doing before
being at this point ?

--
Patrice

<Gouri.Mahaj... @gmail.coma écrit dans le message de groupe de discussion :
0d6b83a9-e3ec-4d9a-b832-a9703dc08...@i3 6g2000prf.googl egroups.com...
Hello,
I am new to asp.net. when i close the browser programmaticall y I
am getting an application error at the line given below.
<param name="SessionID " value="<%= Session["SessionID"] %>"/>
because of the session no more exists. Can anybody please tell me how
to handle that error.
Thanks in advance.
Regards,
Gouri.- Hide quoted text -

- Show quoted text -
Actually I am loading the user control on the browser and passing the
session Id of the page as the parameter to the user control. When
disconnect button on my web page is clicked I am calling
session.abandon method and closing the browser using java script.
After that the control is passed to the line which I have mentioned
earlier (During execution) in that case the session is no more
exists. So I am getting an error to that line. Can you please tell me
how to handle that error not to occur.

Thanks.
Jun 27 '08 #8

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

Similar topics

9
3206
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is indeed also true for our language of choice, Python. Its file type allows some extraordinary convenient access like: for line in open("blah"): handle_line(line)
7
6007
by: Noor | last post by:
please tell the technique of centralize exception handling without try catch blocks in c#.
12
6696
by: Christian Christmann | last post by:
Hi, assert and error handling can be used for similar purposes. When should one use assert instead of try/catch and in which cases the error handling is preferable? I've read somewhere that assert could be used to start an interactive debugger automatically. How do I realize that on a Linux machine using gcc?
21
4427
by: Anthony England | last post by:
Everyone knows that global variables get re-set in an mdb when an un-handled error is encountered, but it seems that this also happens when the variable is defined as private at form-level. So if "global variables get re-set" doesn't tell the whole story, then what does? ***please note*** I'm not looking for a solution - I'm looking for a more detailed description of what happens when an un-handled error occurs - possibly with help file...
4
2525
by: aaj | last post by:
Hi all I have an automated application, that runs in the middle of the night. If certain 'non system' errors occur (things like malformed files, missing files etc..), I send an automatic Email and write a record to the database. This is handled in a class. When these errors occur, once Emailed and written I want to just end the App, simple as that.
1
483
by: michaeltorus | last post by:
Hi I'm currently designing a new web application in .Net. I've pretty covered everything, apart from error handling. There seems to be a few different way to do this, but something I've read often is that loading all your code with lots of try / catch blocks is not the best way. My application is made up of a number of different sub applications. A CRM Package, with financial services, compliance and commisions etc etc. Each part has...
4
1939
by: Al Williams | last post by:
Hi, I have error handling in place throughout my application. I also start the application wrapped in error handling code to catch any unexpected exceptions (i.e. exceptions that occur where I haven't placed error handling code). When I run my app from the IDE, the unhandled errors are caught by the error handling code in my Sub Main routine and the error details are logged to a text file and optionally e-mailed to me for follow-up.
1
1872
by: GS | last post by:
Any points of what would be the good error handling design for application? User error handling in Application_OnError and throw() new errors on conditions through the code? I'd like utlimiately to consolidate all error_handling in one method which I'll be able to easily modify to write to event log or text file etc instead of error hanlding scattered through the code. Thanks, GS
35
3809
by: jeffc226 | last post by:
I'm interested in an idiom for handling errors in functions without using traditional nested ifs, because I think that can be very awkward and difficult to maintain, when the number of error checks gets about 3 or so. It also gets very awkward in nested loops, where you want to check for normal loop processing in the loop condition, not errors. Yes, you could put some generic exit flag in the loop condition, but when you're simply done if...
2
1885
by: Omar Abid | last post by:
Reason of this project: Error handling is one of the most difficult thing that may afford a programmer. It isn't as easy as you think and handling errors in a program some time can make errors occur! Project details: 1- New solution for handling errors in .net 2- Try...Catch...Finally Block 3- Error handling sample
0
9666
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
9512
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
9987
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...
1
7531
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
6770
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
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
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
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.