Application_BeginRequest and Request.Params[] under Asp.net 2.0

T

tao lin

Hi, all

I am using VS 2005 under windows 2000.

I just upgrade my asp.net app from 1.1 to 2.0. And I found a very strange
proglem in my Global.asax.cs's Application_BeginRequest function, here is my
code:

protected void Application_BeginRequest(Object sender, EventArgs e) {

if (Request.Params["client"] != null)

this.Context.Items.Add("ClientCode", Request.Params["client"]);

else

throw(new NullClinetException());

......

}

In my Asp.net 1.1, everything works fine. But after I upgraded to Asp.net
2.0, when I input my query string like this:

http://localhost/MyWeb/DesktopDefault.aspx?client=PT&tabindex=1&tabid=10

It raise the follow exception:

NullClinetException: System error.
at PaperTiger.Global.Application_BeginRequest(Object sender, EventArgs e)
in c:\Projects\\MyWeb\App_Code\Global.asax.cs:line 117
at
System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication
..IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)

Is there anything changed between Asp.net 1.1 and 2.0, and I need to modify
my code?

Cheers,

Tao
 
G

Guest

Comment out the line:
throw(new NullClinetException());

Not only is this misspelled, but I am not sure if such an animal as
"nulclientException" exists, unless its a custom class of your.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top