4

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 ....

5
  • are u using like this HttpContext.Current.Request.QueryString["String"]; Aug 30, 2012 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 ? Aug 30, 2012 at 6:03
  • when i used HttpContext.Current.Request.QueryString["String"]; that give the null value Aug 30, 2012 at 6:04
  • there is querystring in url? Aug 30, 2012 at 6:13
  • Yes, it is "ID" and i want to get value of that ID Aug 30, 2012 at 6:50

1 Answer 1

3

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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