Archive for the ‘QueryString’ Category

Below is the code to create a link in a page which includes some value from the querystring of the current page.

var qsParm = new Array();
function qs()
     var query =;
     var parms = query.split('&');
     for (var i=0; i<parms.length; i++)

         var pos = parms[i].indexOf('=');
         if (pos > 0)

             var key = parms[i].substring(0,pos);

             var val = parms[i].substring(pos+1);
             qsParm[key] = val;
qsParm['ID'] = null;
var addressTr= "Technical%20View.aspx?ID=" +  qsParm['ID'] ;
document.write('<a target="_self" href="' + addressTr + '">Technical View</a>');


Add System.Web namespace

public class MyEventHandler: SPItemEventReceiver
HttpContext current;

String requestNumber;
public MyEventHandler()
current = HttpContext.Current;
public override void ItemAdded(SPItemEventProperties properties)
// code  for event handler goes here


Since event handler methods doesn’t have access to the page object we cant access query string and Session values.
So you can use the current object to access the query string and Session values.