This is a migrated thread and some comments may be shown as answers.

[Solved] Script Registrar : Can not render twice

2 Answers 154 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frank Michael
Top achievements
Rank 1
Frank Michael asked on 04 May 2010, 11:00 PM
Sometimes I get the exception: Script Registrar : Can not render twice
What does this mean?
The situation is, that I have typed the wrong password for my login, then the right. Then the exception is raised.

2 Answers, 1 is accepted

Sort by
0
Accepted
Marcus Eddy
Top achievements
Rank 1
answered on 06 May 2010, 12:07 PM
Hi Frank,

Make sure you don't have <%= Html.Telerik().ScriptRegistrar twice,

if you want to register other scripts you just call Html.Telerik().Scriptregistrar the second time in other words the <%= is only called once for the initial render usually on the masterpage.

Cheers,
Marcus
0
Frank Michael
Top achievements
Rank 1
answered on 06 May 2010, 06:50 PM
In Site.main I have

    <%Html.RenderPartial("Script"); %> 
 
</body> 
</html> 

Which is:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> 
 
    <% Html.Telerik().ScriptRegistrar() 
                     .Globalization(true) 
                     .DefaultGroup(group => group 
                         .Add("Silverlight.js") 
                         .Add("Silverlight-OnError.js") 
                         .Add("telerik.common.js") 
                         .Add("telerik.panelbar.js") 
                         .Add("telerik.calendar.js") 
                    ) 
                     .Render(); %> 

To me it seems it fulfils your condition.
Tags
General Discussions
Asked by
Frank Michael
Top achievements
Rank 1
Answers by
Marcus Eddy
Top achievements
Rank 1
Frank Michael
Top achievements
Rank 1
Share this question
or