Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2008

Tip: Looking for answers? Try searching our database.

Handling application error in asp.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gouri.Mahajan7@gmail.com - 22 May 2008 09:08 GMT
Hello,

    I am new to asp.net. when i close the browser programmatically 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.
Patrice - 22 May 2008 09:43 GMT
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.Mahajan7@gmail.com> a écrit dans le message de groupe de discussion :
0d6b83a9-e3ec-4d9a-b832-a9703dc08005@i36g2000prf.googlegroups.com...
> Hello,
>
[quoted text clipped - 10 lines]
> Regards,
> Gouri.
Gouri.Mahajan7@gmail.com - 22 May 2008 10:29 GMT
> I'm not sure how you can process a request if the browser is closed. You
> perhaps explicitely called Session.Abandon ???
[quoted text clipped - 24 lines]
>
> - 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.
Patrice - 22 May 2008 11:12 GMT
> 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
[quoted text clipped - 4 lines]
> 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.
Mark Rae [MVP] - 22 May 2008 11:50 GMT
> 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();

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Gouri.Mahajan7@gmail.com - 22 May 2008 12:40 GMT
> > Also I'm surprised closing the browser using JavaScript works. It should
> > at least ask a question to the user.
[quoted text clipped - 10 lines]
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net

Hello,

Still it is giving an error. Can you please tell me other otions.
Mark Rae [MVP] - 22 May 2008 12:46 GMT
>>> Also I'm surprised closing the browser using JavaScript works. It should
>>> at least ask a question to the user.
[quoted text clipped - 8 lines]
>
> 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...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Juan T. Llibre - 22 May 2008 14:24 GMT
re:
!> 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.

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/
======================================
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 ???
[quoted text clipped - 24 lines]
>
> - 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.