Adding JavaScriptEmbedControl corrupt's Designer file.

Posted by Community Admin on 04-Aug-2018 12:37

Adding JavaScriptEmbedControl corrupt's Designer file.

All Replies

Posted by Community Admin on 14-Oct-2011 00:00

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

Posted by Community Admin on 18-Oct-2011 00:00

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

Posted by Community Admin on 18-Oct-2011 00:00

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

Posted by Community Admin on 18-Oct-2011 00:00

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

This thread is closed