Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Application_BeginRequest and Request.Params[] under Asp.net 2.0

Reply
Thread Tools

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

 
 
tao lin
Guest
Posts: n/a
 
      03-24-2006
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/DesktopDefaul...dex=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(IExecutionS tep step, Boolean&
completedSynchronously)

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

Cheers,

Tao






 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      03-26-2006

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


--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"tao lin" wrote:

> 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/DesktopDefaul...dex=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(IExecutionS tep step, Boolean&
> completedSynchronously)
>
> Is there anything changed between Asp.net 1.1 and 2.0, and I need to modify
> my code?
>
> Cheers,
>
> Tao
>
>
>
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application_BeginRequest and the Page object Mark Rae ASP .Net 21 06-20-2008 06:10 PM
Java script error when URL's modified in Application_EndRequest and Application_BeginRequest Wayne Sepega ASP .Net 1 01-06-2006 03:24 PM
Catch WebMethod name and params in Application_BeginRequest Franck ASP .Net 1 10-04-2005 11:26 AM
Catch WebMethod name and params in Application_BeginRequest Franck ASP .Net Web Services 0 09-30-2005 06:47 AM
Can Application_BeginRequest return a DataSet and stop normal webmethod flow? ASP .Net Web Services 1 05-25-2005 06:02 PM



Advertisments