Mar 14, 2012, 6:09 AM
[CLOSED] Rendering html in a user control
Hi there,
I have a method the returns a partial view result to a user control which decodes some html for display:
Controller:
Is there something I can do in the user control to properly render the decoded html like I was able to render it in the view?
Thanks for any suggestions.
I have a method the returns a partial view result to a user control which decodes some html for display:
Controller:
public ActionResult ViewNote(string id, string organizationName, string timePeriodId)
{
var pr = new Ext.Net.MVC.PartialViewResult();
pr.SingleControl = true;
pr.WrapByScriptTag = false;
....
return pr;
}
User Control:
<ext:Panel runat="server" ID="ViewNotes" ClientIDMode="Static" AutoDataBind="true" Hidden="true">
<Content>
<div class="formseperator">
<%= Html.Raw(HttpUtility.HtmlDecode(item.Note))%>
</div>
</Content>
</ext:Panel>
I found that in the user control some html elements (ordered lists for example) did not display correctly while others (like bold) displayed fine. I did an experiment loading content into a regular mvc view page and found that if I set the Ext ResourceManager like so:<ext:ResourceManager ID="ResourceManager" RenderStyles="None" runat="server" />
Then the decoded html would render correctly, however, I'm not sure why.Is there something I can do in the user control to properly render the decoded html like I was able to render it in the view?
Thanks for any suggestions.
Last edited by Daniil; Mar 14, 2012 at 8:31 PM.
Reason: [CLOSED]