the this. on requests

  • Thread starter Thread starter Cindy Lee
  • Start date Start date
C

Cindy Lee

Sorry if this is a bad questions, but does it matter if I use,
this.Request.QueryString or just Request.QueryString to get my url
parameters? Will they both do the same?
 
No, they are not the same. One has a more explicit scope than the
other.

In a general sense you can do this fine with no problems but if you
have a scope change you may get different results.

In other words, if, for some reason, there is an instance or local
variable named "Request" it will conflict with the global Request
object. The odds of this happening are slim (since this is a reserved
word as well as an object name) but that's the difference - scope.

Tom P.
 

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

Back
Top