Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

share|improve this answer
    
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! –  Peter Jul 25 '13 at 11:25

Your Answer

 
discard

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.