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

Forums / Developing with Sitefinity / How to set WrapperTag in Sitefinty Widget

How to set WrapperTag in Sitefinty Widget

6 posts, 0 answered
  1. Jaydeep
    Jaydeep avatar
    6 posts
    Registered:
    17 Sep 2014
    12 Jan 2015
    Link to this post

    Hello All,

     I am developing a custom Sitefinity widget using user control. 

    After adding custom widget on Page I found that it is rendered in SPAN tag. I want to change that wrapper tag to DIV for maintaining HTML structure across the site.

     

    I checked some inbuilt controls having WrapperTag property to set the wrapper tag of HTML. I also checked the SimpleView base case of widget but I cannot able to locate the WrapperTag property.

     

    Please help me to set the wrapper element to Div instead of Span in custom widget.

     

    Thanks in Advance,

    Jaydeep Jadav

     

  2. Jaydeep
    Jaydeep avatar
    6 posts
    Registered:
    17 Sep 2014
    23 Feb 2015
    Link to this post
    Can anyone help on this?
  3. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    Registered:
    04 Jan 2016
    26 Feb 2015
    Link to this post
    Hello,

    I have tested the reported behavior with a User Control and in all cases, the control was rendered in a div and not a span. Would it be possible to clarify if on your end both user and custom controls get rendered in a span? What is the page template that you have configured for the page? Do you get the same behavior on a page without template?

    Regards,
    Atanas Valchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  4. Jaydeep
    Jaydeep avatar
    6 posts
    Registered:
    17 Sep 2014
    26 Feb 2015 in reply to Atanas Valchev
    Link to this post

    Hello,

    Thanks for your support.

     

    Yes, I am getting same behavior in With template and without template. It is always render in span tag. I used SimpleView / ascx custom widget.

     

    Thanks,

    Jaydeep Jadav

  5. Ivan Eftimov
    Ivan Eftimov avatar
    23 posts
    Registered:
    20 Jul 2016
    02 Mar 2015
    Link to this post
    Hi Jaydeep,

    In order to change the wrapping tag you should override the TagKey property of your widget. Through this property you have a variety of choices (not only div) for wrapping tag. Following is an example for setting a div as a wrapping tag:

    protected override System.Web.UI.HtmlTextWriterTag TagKey
    {
        get
        {
             return System.Web.UI.HtmlTextWriterTag.Div;
        }
    }

    Tell us if this works for you.

    Regards,
    Ivan Eftimov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  6. Prateek
    Prateek avatar
    4 posts
    Registered:
    05 Feb 2014
    07 Nov 2015
    Link to this post

    Hi Ivan Eftimov,

    Thanks you Ivan. It works. Now my custom widget is rendered in a div.

    Regards,
    Prateek

6 posts, 0 answered