0

With String accountName = this.Context.Request.QueryString["accountname"].ToString(); im getting the needed value for the filter webpart on my ListWebPart.

If im paging my List, the url changes and i can't query my url string anymore with that my filter crashes and i receive an exception.

Is there a way to persist my "accountname" from the querry string to use it through out the paging?

1 Answer 1

0

If you are only using your own "accountname", you might be better-off using SPContext.Current.Web.CurrentUser instead.

Otherwise, if "accountname" could be any account (not only yours), you could store it in a session variable, but if your SharePoint is running on a web farm, and you bounce to a different server (load-balancing), your session will be empty (unless your admin is using an external "session state server"). It isn't likely to happen very often, but it could irritate your users. You might want to check on that.

1
  • I want to get the user profile of the page which user is currently displayed, so CurrentUser won't work for me. Do you know another way to get the object of the currently displayed user? I will look into the session variables.. thanks so far! Commented Jul 25, 2013 at 11:25

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.