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

Forums / Developing with Sitefinity / Using Message Control

Using Message Control

3 posts, 0 answered
  1. Courtney
    Courtney avatar
    9 posts
    Registered:
    30 Mar 2005
    18 Sep 2007
    Link to this post
    Hello,

    I'm building a pluggable module to our Sitefinity site and I've looked at some of the pre-built controls (like blogs, news, etc) and noticed there's a control called MessageControl. I'm assuming these handle the messages that get displayed after saving (or some other action).

    Does anyone have some sample code they've made to make use of this control? Something that shows how to get and set the text inside the control? I just want to keep the UI as similar to the other modules as possible.

    Thanks,
    Richie
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    19 Sep 2007
    Link to this post
    Hi Richie,

    If you have a template, you need to have the MessageControl in it:

    <%@ Register TagPrefix="sfMsg" Namespace="Telerik.Cms.Web.UI" Assembly="Telerik.Cms.Web.UI" %> 
     
    <sfMsg:MessageControl runat="server" ID="message1"
            <ItemTemplate> 
                <asp:Label runat="server" ID="messageText"></asp:Label> 
            </ItemTemplate> 
    </sfMsg:MessageControl> 
     

    After that you could access it in the code and set the message itself through the Message property.

    Also, you could instantiate the MessageControl in the code as follows:

    MessageControl msgCtrl = new MessageControl(); 
    msgCtrl.ID = "message"

    Hope this helps.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Courtney
    Courtney avatar
    9 posts
    Registered:
    30 Mar 2005
    19 Sep 2007
    Link to this post
    Hi Pepi,

    Thanks for the info - it certainly helped :) Apparently, I completely overlooked the property "Message".

    Thanks again,

    Richie
Register for webinar
3 posts, 0 answered