how to get the current web when my class inherits from SPFieldText

Hi,
I am writing a custom field control that inherits from SPFieldText.
I need to access the current web as an SPWeb in the FieldRenderingControl method that i override.


When I try: SPWeb spw = SPContext.GetContext(Context).Web;
That doesn t work. iT SAYS: Error : The name 'Context' does not exist in the current context

Any idea how I can do that PLS




Answer this question

how to get the current web when my class inherits from SPFieldText

  • drdexter33

    Yep:

    SPWeb spw = SPContext.Current.Web;



  • Ken Harris

    That

    SPWeb spw = SPContext.Current.Web;

     worked perfectly|:

    SPContext.GetContext(HttpContext.Current).Web;

    also works but yours is much simpler

    Thank you

     



  • how to get the current web when my class inherits from SPFieldText