|
-
Apr 3rd, 2005, 10:41 PM
#1
Thread Starter
New Member
Collecting GET variable in Global.ascx?
Greetings All, I want to collect a quesrystring parameter (HTTP GET variable) in the global.ascx file (either in application start or session start) Is this possible? I.E. in GLOBAL.ascx under the APPLICATION_START event, put a piece of code that collects the parameter using
request.params("paramtername")?
-
Apr 4th, 2005, 06:49 AM
#2
Thread Starter
New Member
Re: Collecting GET variable in Global.ascx?
Ok I figured it out... moved my request from Application_Start, to Application_BeginRequest and it handled it. Was just a matter of me realizing when these events fire!!
-
Apr 4th, 2005, 06:50 AM
#3
Re: Collecting GET variable in Global.ascx?
I'm interested in knowing what code you used. Can you paste it here?
-
Apr 4th, 2005, 10:31 AM
#4
Thread Starter
New Member
Re: Collecting GET variable in Global.ascx?
Here ya go, bascially Im populating a hashtable to hold the settings for a site based on the querysting in the url. This is done to spawn multiple sites from a single backend SQL database where layout values are held.
VB Code:
Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
'Gets the querystring value and holds it in a public shared variable
VB.CorpID = Request.Params("CorpID")
'if the variable isn't zero then do something
If VB.CorpID <> 0 Then
VB.SiteTable = VB.LoadConfig(VB.CorpID)
End If
Else
'TODO: Insert Redirection to Error Page Here
Throw New HttpException(404, "not found")
End If
Last edited by mlynch3261; Apr 4th, 2005 at 10:40 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|