the this. on requests

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cindy Lee

    the this. on requests

    Sorry if this is a bad questions, but does it matter if I use,
    this.Request.Qu eryString or just Request.QuerySt ring to get my url
    parameters? Will they both do the same?


  • Tom P.

    #2
    Re: the this. on requests

    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.

    On Feb 27, 3:15 pm, "Cindy Lee" <cindy...@hotma il.comwrote:
    Sorry if this is a bad questions, but does it matter if I use,
    this.Request.Qu eryString or just Request.QuerySt ring to get my url
    parameters? Will they both do the same?

    Comment

    Working...