Try Now
More in this section

Forums / General Discussions / User Controls via HTML

User Controls via HTML

2 posts, 0 answered
  1. Jaymie
    Jaymie avatar
    27 posts
    30 Jan 2009
    25 Aug 2010
    Link to this post
    I need to add a user control to the page without dragging and dropping.
    I have tried all sorts to get this to work but it just wont.

    This is what I am trying to do.

    I have added this line to the web.config in the root of the SiteFinity site:
    <add tagPrefix="uc1" tagName="RightContactLinks" src="~/UserControls/Custom_Controls/RightContactLinks.ascx" />

    and then to the actual code of the Generic Content Control, I have added this:
    <div id="rightCol">
        <uc1:RightContactLinks ID="RightContactLinks1" runat="server" />

    but nothing appears. There are no errors and the control is listed in the Toolbox (as I uploaded it as normal) and I can add that to the page by itself, but I can not add it half way down the page. The full code of the Generic Content is this:

    <div id="pageContainer">
        <h2 class="tcGreen">Contact us</h2>
        <div id="leftCol">
        <script src="http://maps.google.com/maps?file=api&;v=2&sensor=false&key=ABQIAAAAZ5lEXKGy2wVOmJBnDCttsBTib8EIdP2sBRLCG7BKolyfcatogBQ6JvLyQxgDUFIJr8h5wUILPTyieg" type="text/javascript"></script>
            <script type="text/javascript">
                function initialize() {
                  if (GBrowserIsCompatible()) {
                    var map = new GMap2(document.getElementById("map_canvas"));
                    map.setCenter(new GLatLng(53.473121,-2.251481), 16);
                    var point = new GLatLng(53.473152,-2.251232);
                    var marker = new GMarker(point);
                $(document).ready( function () {
            <div id="map_canvas">
            <div class="newRow font13">
                <p><span class="highlightBlue">Bright Digital</span><br />
                2 Riverside Mews, <br />
                4 Commercial Street<br />
                Manchester <br />
                M15 4RQ, <br />
                United Kingdom </p>
                <p>T: +44 (0)207 183 2670<br />
                E: theteam@brightdigital.co.uk </p>
                <p><a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=2+Riverside+Mews+4+Commercial+Street+Manchester+M15+4RQ&sll=37.0625,-95.677068&sspn=51.222969,114.257812&ie=UTF8&z=16" target="_blank" class="greenLink">Find us on Google maps</a> </p>
        <div id="rightCol">
            <uc1:RightContactLinks ID="RightContactLinks1" runat="server" />

    I know I could make a template with 2 columns for this page only, but I don't want to have to do that, I would rather just insert the code like above and for it to just work.
    Could you let me know what I am doing wrong?
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    25 Aug 2010
    Link to this post
    Hello Jaymie,

    Thank you for using our services.

    The Generic Content control cannot be used to include server side controls in the markup. It works with HTML and can be used for HTML controls only - not ASP.NET Controls. If you wish you can add the control through markup in the master page file.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered