SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created custom webpart and deployed on default edit page. now i wnt to access the ListItem ID from the Page URL but it gives error that you can not use request.Query String in Office 365.

How can i access ID from URL ? is there any option to access this? Reply as soon as possible ....

share|improve this question
are u using like this HttpContext.Current.Request.QueryString["String"]; – Vishal_Sharepoint Aug 30 '12 at 5:57
I have used HttpContext.Current.Request.QueryString["String"]; and Page.Request.QueryString["String"] but both are not working. do you have any option to access url in sharepoint online ? – Vikalp Kapadiya Aug 30 '12 at 6:03
when i used HttpContext.Current.Request.QueryString["String"]; that give the null value – Vikalp Kapadiya Aug 30 '12 at 6:04
there is querystring in url? – Vishal_Sharepoint Aug 30 '12 at 6:13
Yes, it is "ID" and i want to get value of that ID – Vikalp Kapadiya Aug 30 '12 at 6:50
up vote 3 down vote accepted

What error are you getting exactly? I have used

string sourceID = Convert.ToString(Page.Request.QueryString["ID"]);

in Office365/SharePoint Online successfully without getting any error.

Also, I see that you have passed "String" inside the square brackets instead of "ID". Could that be an issue? You need to pass the exact name of parameter you want the value of.

share|improve this answer
Yes,Its Working. Thanks.. – Vikalp Kapadiya Aug 31 '12 at 13:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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