1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / HtmlField in Custom Control

HtmlField in Custom Control

6 posts, 0 answered
  1. John
    John avatar
    61 posts
    Registered:
    08 Jun 2012
    25 Aug 2011
    Link to this post
    Hello,

    We have followed Josh Morales' Intra-site blog entry (http://www.sitefinity.com/blogs/joshmorales/posts/11-05-26/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
  2. Conrad Ehinger
    Conrad Ehinger avatar
    59 posts
    Registered:
    22 Sep 2009
    26 Aug 2011
    Link to this post
    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
  3. John
    John avatar
    61 posts
    Registered:
    08 Jun 2012
    26 Aug 2011
    Link to this post
    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

  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Aug 2011
    Link to this post
    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 >>

  5. Alf
    Alf avatar
    6 posts
    Registered:
    05 Jan 2012
    19 Apr 2012
    Link to this post
    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.

  6. Alf
    Alf avatar
    6 posts
    Registered:
    05 Jan 2012
    19 Apr 2012
    Link to this post
    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.

6 posts, 0 answered