1

I have read this article: http://www.sharepointkings.com/2008/06/redirection-from-event-handler.html , and i put this line in my code: SPUtility.Redirect("Event.aspx", SPRedirectFlags.Trusted, HttpContext.Current); But debuger show me that is no Context. It don't cnow what context it is.

3

Answer to your problem is in the same article: http://www.sharepointkings.com/2008/05/httpcontext-in-eventhandler.html. Save HttpContext to the field in the constructor of your event handler class.

public class MyEventHandler: SPItemEventReceiver 
{
    HttpContext current;
    public MyEventHandler()
    { 
        current = HttpContext.Current;
    }
    ...
}
  • But it vrite me that method schould have return type. – Grzegorz Z Oct 27 '12 at 19:35
  • And MyEventHandler() is getting underline red. – Grzegorz Z Oct 27 '12 at 19:36
  • 1
    MyEventHandler() is not a method, it is constructor. So, I think the problem is in incorrect syntax in your class. – Dmitry Kozlov Oct 27 '12 at 19:44
  • So how I can it manage ? – Grzegorz Z Oct 27 '12 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.