Posted By

nickaranz on 05/28/11


Tagged

Development sharepoint 2010


Versions (?)

Getting Query String from Event Receiver


 / Published in: C#
 

only works in async. events. Ending in "ing"

  1. // setting the current context MUST be done in the constructor and is only valid for Synchronous events
  2. private HttpContext currentHttpContext = null;
  3.  
  4. public EventReceiver1(): base()
  5. {
  6. currentHttpContext = HttpContext.Current;
  7. }
  8.  
  9. // this in your actual event function
  10. string MyValue = currentHttpContext.Request.QueryString["Parameter"];

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Ava on December 31, 2011

hi , why my httpcontex.current in my constructor is null? i confuse ... if it is null i can't use this way for get httpcontex.current and save it for asyncronous events.

You need to login to post a comment.