PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

[ASP.NET] Unable to manipulate ZoomASPX render

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [ASP.NET] Unable to manipulate ZoomASPX render

    Hello, I'm in need of modifying some output that is being generated for ZoomASPX control in my code. Typical way of doing this is to render control into temporary HtmlTextWriter where it can be manipulated before written into real page HtmlTextWriter that is to be sent to client. Sample code snippet:
    Code:
            protected override void Render(HtmlTextWriter writer)
            {
                using (var htmlwriter = new HtmlTextWriter(new StringWriter()))
                {
                    ASPXSearch.RenderControl(htmlwriter);
                    string modifiedOutput = htmlwriter.InnerWriter.ToString().Replace("Default.aspx", "Search-Results.aspx");
                    writer.Write(modifiedOutput);
                }
            }
    However ASPXSearch control then renders into a display of cool asian characters
    敐浲獩楳湯搠湥敩⹤�潌⁧楦敬慮敭愠摮瀠瑡⁨潮⁴潦湵⁤吨獥⹴潬
    in length comparable to the supposed content.

    SOLVED: Next post.
    Last edited by Xeevis; Dec-11-2011, 04:01 AM.

  • #2
    Damn I'm lame, just happened to solve it by comparing page and new HtmlTextWriter's encodings one has UTF-8 and other has Unicode so I changed both to be UTF-8 and it worked ... Zzzz. Next time controls speak to me chinese I'll know .

    Comment


    • #3
      Glad to hear you've found the cause. Yes, it's important for the encoding to match in such a case and a generic mention of "Unicode" tends to refer to "UTF-16" instead of "UTF-8" (even though both are technically Unicode encodings).

      Looking at your original post, I'm not sure what you are replacing there, but if it is all the links back to the search page that needs to be changed (i.e. you are hosting the control within "Search-Results.aspx" and all the internal links to sort results etc. point to "Default.aspx"), then you can change this via the Indexer setting without needing to post-process the search results: Configure -> Advanced -> Link back URL.
      --Ray
      Wrensoft Web Software
      Sydney, Australia
      Zoom Search Engine

      Comment

      Working...
      X