title: How to retrieve the querystring in Sharepoint itemadded event
body: <p>Please help.</p>
  
  <p>I have two different lists from within one site. </p>
  
  <p>In one list, I have appended a querystring to the new form which will represent the EMP_ID of the user. In here, I have a hidden field "Name" to represent the record filled out by the user. This "Name" field is referenced from the other table with the EMP_ID value.</p>
  
  <p>The following is my code:</p>
  
  <pre><code>        try
          {
              SPSite ohportal = new SPSite("http://moss2007dev:1234");
              SPWeb site = ohportal.OpenWeb();
              SPList vitality = site.Lists[properties.ListId];
              SPList employees = site.Lists["Employees List"];
              SPListItemCollection vitalityCollection = vitality.Items;
              SPListItemCollection employeesCollection = employees.Items;
  
              SPListItem currentItem = properties.ListItem;
  
              string empId = HttpContext.Current.Request.QueryString["EMP_ID"].ToString();
              foreach(SPListItem item in employeesCollection)
              {
                  if(item["EMP_ID"].Equals(empId)){
                      string name = item["Name"].ToString();
                      currentItem["Name"] = name;
                  }
              }
          }
          catch (Exception err)
          {
              properties.ErrorMessage = "ERROR: " + err.Message;
          }
  </code></pre>