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

Forums / General Discussions / Custom Meta Tags for pages

Custom Meta Tags for pages

12 posts, 0 answered
  1. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    12 Apr 2008
    Link to this post
    First of all I was receiving the following error when clicking the add tag link for pages.

    Type : System.Web.HttpException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
        Message : Server cannot modify cookies after HTTP headers have been sent.
        Source : System.Web
        Help link :
        ErrorCode : -2147467259
        Data : System.Collections.ListDictionaryInternal
        TargetSite : Void BeforeCookieCollectionChange()
        Stack Trace :    at System.Web.HttpResponse.BeforeCookieCollectionChange()
           at System.Web.HttpCookieCollection.Add(HttpCookie cookie)
           at System.Web.Security.RoleManagerModule.OnLeave(Object source, EventArgs eventArgs)
           at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
           at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


    The solution was to change the web.config roleManager from 

    cacheRolesInCookie="true"

    to 

    cacheRolesInCookie="false"


    Sedond, perhaps I am missing something simple. But how do you add a new meta tag name to the drop down list. eg "Copyright"?

    Sincerely,

    Ben
  2. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    15 Apr 2008
    Link to this post
    Hi Ben,

    Regarding the reported error, we cannot reproduce it locally, even when cacheRolesInCookie="true". Seems it is something specific for your project. Could you provide more information.

    As for your second question: unfortunately, currently the user interface for page meta tags is not set for adding additional tags.

    We can provide you the following solution for your case:

    Create a custom control and add it to the toolbox, e.g.:

    using System; 
    using System.Web.UI; 
    using System.Web.UI.HtmlControls; 
     
     
    public class CustomMetaTag : Control 
        public string Name 
        { 
            get 
            { 
                return this.name; 
            } 
            set 
            { 
                this.name = value; 
            } 
        } 
     
        public string Content 
        { 
            get 
            { 
                return this.content; 
            } 
            set 
            { 
                this.content = value; 
            } 
        } 
     
     
        protected override void OnPreRender(EventArgs e) 
        { 
            if (!String.IsNullOrEmpty(this.Content)) 
            { 
                HtmlMeta meta = new HtmlMeta(); 
                meta.Content = this.Content; 
                if (!String.IsNullOrEmpty(this.Name)) 
                    meta.Name = this.Name; 
                this.Page.Header.Controls.Add(meta); 
            } 
            base.OnPreRender(e); 
        } 
     
        private string name; 
        private string content; 

    After adding the control to the cms page in Edit Page mode and set its Name and Content properties, it will add an HTML meta tag to the page header.

    Hope this is helpful.

    Best wishes,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Benjamin
    Benjamin avatar
    6 posts
    Registered:
    30 Jan 2008
    22 Jul 2009
    Link to this post
    I just had the same problem w/ the cookies and changing the 'cacheRolesinCookie' setting fixed it.

    I'm using v3.6.
    My role and Membership provider are the Telerik Active Directory providers.

    Here is the response from the server after I clicked on the 'meta' link from 'Add Head Tags' section. It's a partial page refresh. The error is at the end of the dump.


    HTTP/1.1 200 OK

    Date: Wed, 22 Jul 2009 17:30:41 GMT

    Server: Microsoft-IIS/6.0

    X-Powered-By: ASP.NET

    WWW-Authenticate: Negotiate oYGgMIGdoAMKAQChCwYJKoZIgvcSAQICooGIBIGFYIGCBgkqhkiG9xIBAgICAG9zMHGgAwIBBaEDAgEPomUwY6ADAgEXolwEWg1y3pc4AMbWqRxAfu1ooA6QHjO9dYrUJy7UIap8qiS/81x4fFlDFRaJYIZvxCVlVRd3/AOQAtVxE58lfsOjtqd4lByrvO6LWitvD4zUqP6sua9sbCSTmBwIww==

    X-AspNet-Version: 2.0.50727

    Transfer-Encoding: chunked

    Cache-Control: private

    Content-Type: text/plain; charset=utf-8

    366c

    13851|updatePanel|ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Panel1|

     

     

    <h3>Head Content</h3>

    <fieldset class="set">

    <ol class="setIn clearfix">

    <li>

    <h5><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Title" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Label4">Title </label><a href="ControlTemplates/Pages/#" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox6_helpLink" onclick="return false;" class="HelpBox" title="About Titles"> (?) </a><div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox6_ctl00" style="display:none;">

    <!-- 2009.1.410.20 --><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox6_ctl00_ClientState" name="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox6_ctl00_ClientState" type="hidden" />

    </div></h5>

    <input name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$Title" type="text" value="Home" maxlength="125" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Title" />

    </li>

    <li class="description">

    <h5><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Description" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Label5">Description </label><a href="ControlTemplates/Pages/#" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox7_helpLink" onclick="return false;" class="HelpBox" title="About Description"> (?) </a><div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox7_ctl00" style="display:none;">

    <input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox7_ctl00_ClientState" name="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox7_ctl00_ClientState" type="hidden" />

    </div></h5>

    <textarea name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$Description" rows="2" cols="20" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Description">Home</textarea>

    </li>

    <li class="keywords">

    <h5><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Keywords" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Label7">Keywords </label><a href="ControlTemplates/Pages/#" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox8_helpLink" onclick="return false;" class="HelpBox" title="About Keywords"> (?) </a><div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox8_ctl00" style="display:none;">

    <input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox8_ctl00_ClientState" name="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_labelHelpBox8_ctl00_ClientState" type="hidden" />

    </div></h5>

    <textarea name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$Keywords" rows="2" cols="20" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_Keywords"></textarea>

    <p class="example">Separate keywords by commas. <strong>Example:</strong> <q>music, guitar, song</q></p>

    </li>

    </ol>

    </fieldset>

    <div class="bottom"><div><!-- --></div></div>

     

     

    <div class="more">

    <div class="dropDownPanel" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_MoreOptionsPanel">

    <a class="ex" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_MoreOptionsPanel_lnk" href="javascript:togleddpanel('ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_MoreOptionsPanel')" onclick="needToConfirm = false;" allowDesignTime="true">More options <span>(security, performance, URLs, head tags)</span></a><div class="ddlContent" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_MoreOptionsPanel_cnt" style="display:block;">

     

    <fieldset class="security set">

    <div class="setIn">

     

    <h4>Security</h4>

    <ul class="radioList clearfix">

    <li class="radio clearfix">

    <h5>Anonymous access <a href="ControlTemplates/Pages/#" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox2_helpLink" onclick="return false;" class="HelpBox" title="About Anonymous Access"> (?) </a><div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox2_ctl00" style="display:none;">

    <input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox2_ctl00_ClientState" name="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox2_ctl00_ClientState" type="hidden" />

    </div></h5>

    <div class="directionFloat">

    <div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_DenyAnonymous">

    <ul>

    <li><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_DenyAnonymous_0" type="radio" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$DenyAnonymous" value="0" checked="checked" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_DenyAnonymous_0">Allow</label></li><li><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_DenyAnonymous_1" type="radio" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$DenyAnonymous" value="1" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_DenyAnonymous_1">Deny</label></li>

    </ul>

    </div>

    </div>

    </li>

    <li class="radio clearfix">

    <h5>Require SSL <a href="ControlTemplates/Pages/#" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox3_helpLink" onclick="return false;" class="HelpBox" title="About SSL"> (?) </a><div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox3_ctl00" style="display:none;">

    <input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox3_ctl00_ClientState" name="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox3_ctl00_ClientState" type="hidden" />

    </div></h5>

    <div class="directionFloat">

    <div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_ssl">

    <ul>

    <li><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_ssl_0" type="radio" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$ssl" value="1" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_ssl_0">Yes</label></li><li><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_ssl_1" type="radio" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$ssl" value="0" checked="checked" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_ssl_1">No</label></li>

    </ul>

    </div>

    </div>

    </li>

    </ul>

    <h4>Performance</h4>

    <ul class="radioList clearfix">

    <li class="radio">

    <input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_disableViewState" type="checkbox" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$disableViewState" checked="checked" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_disableViewState">Disable ViewState</label>

    </li>

    <li class="radio">

    <fieldset class="cacheSettings">

    <span disabled="disabled" title="Caching is disabled in the web.config or no CachingProvider is found"><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_cacheSettings_requireCaching" type="checkbox" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$cacheSettings$requireCaching" checked="checked" disabled="disabled" onclick="sf_hideCachingPanel(this, 'ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_cacheSettings_requireCachingPanel');" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_cacheSettings_requireCaching">Enable caching</label></span>

    </fieldset>

    </li>

    </ul>

     

     

    <h4>Search Options<em id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_SearchLabel"></em></h4>

    <ul class="radioList clearfix">

    <li class="radio">

    <h5>Index this page<a href="ControlTemplates/Pages/#" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox4_helpLink" onclick="return false;" class="HelpBox" title="About indexing"> (?) </a><div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox4_ctl00" style="display:none;">

    <input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox4_ctl00_ClientState" name="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HelpBox4_ctl00_ClientState" type="hidden" />

    </div></h5>

    <div class="directionFloat">

    <div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_indexing">

    <ul>

    <li><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_indexing_0" type="radio" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$indexing" value="1" checked="checked" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_indexing_0">Yes</label></li><li><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_indexing_1" type="radio" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$indexing" value="0" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_indexing_1">No</label></li>

    </ul>

    </div>

    </div>

    </li>

    </ul>

     

     

    <h4>Page URLs</h4>

    <div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields" class="pageUrl clearfix">

    <div id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl00">

     

    <h5>Generated URL</h5>

    <p class="currentUrl"><strong>~/Home.aspx</strong></p>

    <span id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_DefaultLabel" class="defUrl">Default</span>

     

    <ol id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls" class="addittionaUrl">

    <li>

    <label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls_ctl01_UrlText" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls_ctl01_Label1">Another URL</label>

    <input name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$UrlFields$ctl02$urls$ctl01$UrlText" type="text" id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls_ctl01_UrlText" alt="Additional URL" />

     

    <a id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls_ctl01_SetDefault" class="setDef" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$UrlFields$ctl02$urls$ctl01$SetDefault','')">Set as Default</a>

    <a id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls_ctl01_DeleteButton" class="Delete" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$UrlFields$ctl02$urls$ctl01$DeleteButton&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))">Delete this url</a>

    <span id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls_ctl01_UrlRegExprValidator" class="validMessage" style="color:Red;display:none;"><strong>Please enter a valid URL!</strong></span>

    <p class="example"><strong>Example: </strong><em>~/contacts.aspx</em></p>

    <p class="redirectToDefault"><input id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls_ctl01_Redirect" type="checkbox" name="ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$UrlFields$ctl02$urls$ctl01$Redirect" /><label for="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_urls_ctl01_Redirect">Redirect to the default URL</label></p>

    </li>

    </ol>

    <a id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_UrlFields_ctl02_AddUrl" class="addUrl" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$UrlFields$ctl02$AddUrl&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))">Add Url</a>

     

    </div>

    </div>

     

    <h4>Add Head tags</h4>

    <ol id="ctl00_ContentPlaceHolder1_pageEditor_ctl17_ctl00_ctl00_HeaderTags" class="headTags">

    <li class="commands"><span>Add a tag:</span><ul><li><a class="AddTag" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$HeaderTags$addTagCommands$ctl00$ctl01','')">link</a></li><li><a class="AddTag" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$pageEditor$ctl17$ctl00$ctl00$HeaderTags$addTagCommands$ctl01$ctl01','')">meta</a></li></ul></li>

    </ol>

    </div>

    </fieldset>

    <div class="bottom"><div><!-- --></div></div>

     

    </div>

    </div>

    </div>

     

     

     

    |

    eaa

    <html>

    <head>

    <title>Server cannot modify cookies after HTTP headers have been sent.</title>

    <style>

    body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}

    p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}

    b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}

    H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }

    H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }

    pre {font-family:"Lucida Console";font-size: .9em}

    .marker {font-weight: bold; color: black;text-decoration: none;}

    .version {color: gray;}

    .error {margin-bottom: 10px;}

    .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

    </style>

    </head>

    <body bgcolor="white">

    <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

    <h2> <i>Server cannot modify cookies after HTTP headers have been sent.</i> </h2></span>

    <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

    <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    <br><br>

    <b> Exception Details: </b>System.Web.HttpException: Server cannot modify cookies after HTTP headers have been sent.<br><br>

    <b>Source Error:</b> <br><br>

    <table width=100% bgcolor="#ffffcc">

    <tr>

    <td>

    <code>

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

    </td>

    </tr>

    </table>

    <br>

    <b>Stack Trace:</b> <br><br>

    <table width=100% bgcolor="#ffffcc">

    <tr>

    <td>

    <code><pre>

    [HttpException (0x80004005): Server cannot modify cookies after HTTP headers have been sent.]

    System.Web.HttpCookieCollection.Add(HttpCookie cookie) +103

    System.Web.Security.RoleManagerModule.OnLeave(Object source, EventArgs eventArgs) +650

    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92

    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +64

    </pre></code>

    </td>

    </tr>

    </table>

    <br>

    <hr width=100% size=1 color=silver>

    <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

    </font>

    </body>

    </html>

    <!--

    [HttpException]: Server cannot modify cookies after HTTP headers have been sent.

    at System.Web.HttpCookieCollection.Add(HttpCookie cookie)

    at System.Web.Security.RoleManagerModule.OnLeave(Object source, EventArgs eventArgs)

    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    --><!--

    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->

    0

  4. Harry
    Harry avatar
    23 posts
    Registered:
    07 Aug 2008
    03 Nov 2009
    Link to this post
    Vlad,

    Any chance you could provide a bit more context for your code? Does it have an associated ascx file in front of it? I'm trying to create on my Sitefinity install here and am wondering where to start.

    Harry
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Nov 2009
    Link to this post
    Hello Harry,

    The control does not have a template since it purpose is not to display any date rather than adding metatags. As you can see the control uses HtmlMeta ASP.NET class.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Harry
    Harry avatar
    23 posts
    Registered:
    07 Aug 2008
    03 Nov 2009
    Link to this post
    Hi Ivan,

    So, just to be clear, all you did was put that code in a ascx.cs page and upload it into site finity?

    Harry
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Nov 2009
    Link to this post
    Hi Harry,

    Generally speaking - yes. If you get stuck let me know.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Harry
    Harry avatar
    23 posts
    Registered:
    07 Aug 2008
    03 Nov 2009
    Link to this post
    Hmm... So, I've created a file called CustomMetaTab.ascx.cs containing the code from above. I placed the file in /UserControls/ and updated the web config to contain this:

            <add name="CustomMetaTag" section="Misc" url="~/UserControls/CustomMetaTag.ascx.cs" /> 
          </toolboxControls> 
     

    Everything seems to match up, but when I drag the control onto the page in edit mode, I receive this:

    The file '/UserControls/CustomMetaTag.ascx.cs' does not exist.


    Do I need to restart or reload something?

    Thanks in advance. Telerik is the best!
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Nov 2009
    Link to this post
    Hi Harry,

    Try the line below:

    <add name="CustomMetaTag" section="Misc" url="~/UserControls/CustomMetaTag.ascx" />

    Make sure that the control in in the location above. Also make sure that ascx and cs files exist.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. Harry
    Harry avatar
    23 posts
    Registered:
    07 Aug 2008
    03 Nov 2009
    Link to this post
    Ok - this last question should wrap this up: so, I do need an ascx and an ascx.cs page. The code above is for the ascx.cs page, no? then, what goes in the ascx page?
  11. Harry
    Harry avatar
    23 posts
    Registered:
    07 Aug 2008
    04 Nov 2009
    Link to this post
    Any add'l clarification on this?

    Thanks
  12. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Nov 2009
    Link to this post
    Hello Harry,

    The lines that Ivan has sampled go into the web.config to register the web user control (.ascx file) so that it can be used int he Sitefinity toolbox. What goes in the .ascx file and .ascx.cs depends on functional requirements of the control.

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
12 posts, 0 answered