473,398 Members | 2,335 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,398 software developers and data experts.

Reading session object in global.aspx

I have an application that allows users to select one or more files to
upload to the server. Each of the html file controls is stored in an
array that is held in the session object. This allows the user to
select all the files they need to upload at once before clicking the
upload button. However, the users want a warning to appear if there
are files selected and the user tries to navigate away from the page
without actually clicking the upload button.

(sorry for the long post...almost done)

My solution was to check the session object in the
application_beginrequest event. If the user was attempting to do
something else and the session object had files in it, then redirect
back to the page with a request param that would initiate action to
confirm the user's request. Like this...

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As
EventArgs)
On Error Resume Next
Dim cntx As HttpContext = HttpContext.Current
If UCase(Request.Params.Item("func")) <> "LOANDOCS" And
cntx.Session.Item("filearray") <> Nothing Then
If Err.Number = 0 Then

Response.Redirect("partnerhome.aspx?func=loandocs& pending=1")
End If
End If
On Error GoTo 0
End Sub

My question is quite simply is this acceptable? I'm comfortable with
session management within the web forms, but admittedly don't know
enough about using the global.aspx to feel comfortable about what I'm
doing. If there is a better solution to the problem, I would
appreciate the feedback.

Thanks.

Jun 20 '06 #1
0 1514

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

Similar topics

1
by: Greg Burns | last post by:
I am trying to write a global custom error page. I thought I would jot down some of what I've learned so far... At first I just used the default customErrors section with a defaultRedirect tag,...
9
by: William LaMartin | last post by:
I have a problem, mentioned here before, of Session and Application variables disappearing at one site but not at others or on my development computer. The problem is illustrated by an example...
3
by: Mike Malter | last post by:
I have a general error page that I configured in web.config as <customErrors mode="On" defaultRedirect="CRDefaultError.aspx" /> This error page comes up whenever an error occurs outside of any...
2
by: francois | last post by:
Hi, I would like to redirect the user to the login page after the session time out. I tried to do a trick in the global.aspx.cs protected void Application_BeginRequest(Object sender,...
12
by: ACaunter | last post by:
Hi all, I was wondering how i could write some code which would automatically open the Login Page once the session has expired? -- AdamPC@hotmail.com
10
by: GreggTB | last post by:
I've got an page (LOGIN.ASPX) that receives the user's login information. During the page load, it checks the credentials against a database and, if validation is successful, creates an instance of...
2
by: Gavin Lyons via .NET 247 | last post by:
Hello, I'm writing a newsletter application which uses backgroundthreading. I'm using Session variable to report on progresswhile it loops through a dataset. The 'Status.aspx' pagerefreshes every...
2
by: Markus Prediger | last post by:
Hi NG, I have an asp.net project that uses an vb6 com object for some database-manipulation (I cannot rewrite it in .net, sorry, its not my decision). I want it to be instanciated seperately...
11
by: Dave | last post by:
I have a site with an App_Code folder that has Global.asax.cs and a file named Upload.cs. I want to pass Upload.cs a Session variable (username) that is set in default.aspx. Setting up a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
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...

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.