HtmlField in Custom Control

Posted by Community Admin on 04-Aug-2018 22:29

HtmlField in Custom Control

All Replies

Posted by Community Admin on 25-Aug-2011 00:00

Hello,

We have followed Josh Morales' Intra-site blog entry (www.sitefinity.com/.../creating_intra-site_modules_in_sitefinity_4.aspx).

We are using custom user controls on our administration pages, and we are using traditional postback (and viewstate) as well.

Is it possible to use the HtmlField control in our custom controls? We have placed this control in our admin controls, but some of the functions do not work. For example, if we try to insert a link, and want to choose from an existing site page, no pages appear in the list. Will HtmlField not work with postback?

A snippet from one of our admin controls:

<li>
    <asp:Label ID="LongDescriptionLabel" runat="server" AssociatedControlID="LongDescriptionRichEdit" Text="Long Description" CssClass="sfTxtLbl" />
    <sf:formmanager id="LongDescriptionFormManager" runat="server" />
    <sf:htmlfield id="LongDescriptionRichEdit" runat="server" width="99%" height="370px"
        displaymode="Write" fixcursorissue="True" />
</li>


Thank you for any help!

Regards,
John

Posted by Community Admin on 26-Aug-2011 00:00

John,

If you want to use the html field in your control, you will need to wire it up with your designer. Check out this post:
http://www.avisra.com/blog/2011/05/22/sitefinity-control-designer-fields/

Thanks,

Chris

Posted by Community Admin on 26-Aug-2011 00:00

Thanks Chris, but that's not how we want to use it. We've been through that article, and it indeed talks about using HtmlField controls in *designers*. We would like (if possible) to use these controls directly in an .ascx control - not to edit properties of the control in admin mode.

We have placed the HtmlField control (and a corresponding FormManager control) in our user control, and it works for the basic WYSIWYG editing, but some of the fancy features don't seem to work (like picking a site page when editing a link).

Is there some setting on the control, or other supporting control(s) that we need to add as well to make these fancy features work, or is this a non-starter?

Regards,
John

Posted by Community Admin on 30-Aug-2011 00:00

Hi John,

We have placed the HtmlField control (and a corresponding FormManager control) in our user control, and it works for the basic WYSIWYG editing, but some of the fancy features don't seem to work (like picking a site page when editing a link).

This problem has been resolved in Sitefinity 4.2. We had this reported by clients and we have reworked some of the clientside logic of the HTML field selectors so that the control can be used in a regular user control.

All the best,
Radoslav Georgiev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Posted by Community Admin on 19-Apr-2012 00:00

Hi Radoslav,

in the post http://www.sitefinity.com/devnet/forums/sitefinity/developing-with-sitefinity/pages-not-selectable-for-hyperlinks-in-htmlfield-after-adding-translations.aspx#2067333 I described a similar problem. Is it possible that the behaviour described there has a reason in the same area and that this isn't fixed yet? (We're using Sitefinity 4.4)

Thank you.

Posted by Community Admin on 19-Apr-2012 00:00

Hi Radoslav,

in the post http://www.sitefinity.com/devnet/forums/sitefinity/developing-with-sitefinity/pages-not-selectable-for-hyperlinks-in-htmlfield-after-adding-translations.aspx#2067333 I described a similar problem. Is it possible that the behaviour described there has a reason in the same area and that this isn't fixed yet? (We're using Sitefinity 4.4)

Thank you.

This thread is closed