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

Forums / Bugs & Issues / Adding JavaScriptEmbedControl corrupt's Designer file.

Adding JavaScriptEmbedControl corrupt's Designer file.

4 posts, 0 answered
  1. Naveen
    Naveen avatar
    9 posts
    Registered:
    25 Jul 2011
    14 Oct 2011
    Link to this post
    Hi

    I am creating usercontrol with few textfields in it and some jquery. Whenever i add new control to form a reference is created in designer.cs partial class so that control can be used in code behind as you all know. But this work fine untill i add JavaScriptEmbedControl, if i add any new control after adding JavaScriptEmbedControl designer is not getting updated and it works fine again if i remove JavaScriptEmbedControl .

    Thanks
    Naveen
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Aug 2017
    18 Oct 2011
    Link to this post
    Hi Naveen,

    I have tested adding JavascriptEmbedControl to a widget I created and then added few new controls to the widget. The designer files was updated properly. Can you give me specific control and the script you reference you refer with the JavascriptEmbedControl to better illustrate the problem. I am not sure if this can happen because Visual Studio manages all internal communication between .ascx, codebehind and designer.

    Actually you don`t need the designer files for your widgets, you can delete it since Sitefinity widgets display their designers only in Sitefinity backend and the designer have to be developed separately from the control(for a sample you can check NewsRotator sample available with Sitefinity SDK).

    Best wishes,
    Stanislav Velikov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. Naveen
    Naveen avatar
    9 posts
    Registered:
    25 Jul 2011
    18 Oct 2011
    Link to this post
    This is the code i have

    <%@ Register  Assembly="Telerik.Sitefinity" TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls" %>
    <sf:JavaScriptEmbedControl runat="server" ID="jqModal" ScriptEmbedPosition="BeforeBodyEndTag"
        Url="~/Scripts/jqModal.js">

    I am using sitefinity 4.2, visual studio 2010
  4. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Aug 2017
    18 Oct 2011
    Link to this post
    Hi Naveen,

    Thank you for providing a code sample. The problem is caused by adding the embed control before the end body tag. Please add the embedded script in the head section.
    <sf:JavaScriptEmbedControl runat="server"ID="JavaScriptEmbedControl6"Url="~/RTC_Scripts/series.js"
        ScriptEmbedPosition="Head">
    It gets embedded to the assembly and doesn`t get rendered on the page so it is ok to add it in <head>.

    Best wishes,
    Stanislav Velikov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered