Problems with RenderAsHtml and Private Documents

Recently we’ve been working with creating a webpart to display private documents ‘on’ MySite.

While most things seem to be working smoothly there are a few very quirky things which I am putting out there to see if anyone else has run into the same troubles.

Here’s are some technical details.

When using SPView.RenderAsHtml the following features do not work:

1.) Filter

2.) Sort

3.) Paging

4.) Navigate to subfolder.

We’ll take the instance of navigating to the subfolder as an example.

On a regular ListViewWebPart, when you click on a folder, the page does a post back and the the RootFolder is specified on the query string.

When using SPView.RenderAsHtml, the postback occurs but the RootFolder does not seem to be passed on the query string.

What I would like to know, is if there is a way to pass what the Root Folder a view should start in either to the SPView object or the RenderAsHtml method.

Basically we’re trying to intercept what is normally being displayed by RenderAsHtml.

Just curious as to if anyone has had similar issues. Any input would be greatly appreciated so put those thinking caps on!

This entry was posted in General. Bookmark the permalink.

6 Responses to Problems with RenderAsHtml and Private Documents

  1. Awais Malik says:

    Same problem here, actually what i think is that the RootFolder parameter does get passed in the Query String but that all goes down the drain when u render the view, so it just sits back at the top level. Anybody having a remedy to this?

  2. I’m trying to accomplish a related goal: Given that a user has navigated down to a particular subfolder in a custom list views web part, be able to figure out what the current folder path is in my web part code. Ultimately, I want to control which document content types appear on a custom New menu based on the custom content type of the folder.

    Any ideas?

  3. Phil Shisbey says:

    You’re right. I’m trying to get paging to work with RenderAsHtml but just get error: “This Page has been modified since you opened it. You must open the page again.”

  4. Robert Angers says:

    anyone found an alternative yet? Or got paging to work ?

  5. Deborah French says:

    This Page has been modified since you opened it. You must open the page again.

    Refresh page.

    I get this message when I enter a postback URL on the insert button following data entry. I can refresh the page, and it goes to the page I am sending it to, but dont want users to go through this step. any ideas??? email me please as I am researching the internet and no one has the answer, but have the problem

  6. Victor says:

    I had the same problem, but displaying a list from another site. In that case, I solve the problem by this way, I hope it helps. You must replay the summit url.

    String S = View.RenderAsHtml();

    String patern = “OnClick=’javascript:SubmitFormPost\\(\”.*\\?”;

    String substitution= “OnClick=’javascript:SubmitFormPost(\””+SPContext.Current.Web.Url+”?”;

    S = Regex.Replace(S, patern, substitution);

    After write you can write it in the Render Method using this simple instruction.