Hello there! I'm new to Telerik MVC controls, so excuse me if this is something simple.
I started out with making a new TelerikMvcApplication solution.
Site.Master:
</div>
<%: Html.Telerik().ScriptRegistrar().DefaultGroup(group =>
group.Combined(true).Compress(true).Add("Index.js")) %>
</body>
</html>
Index.aspx:
<%: Html.Telerik().ScriptRegistrar().OnDocumentReady("Index.Init()") %>
</asp:Content>
Index.js:
var Index = function () {
return {
Init: function () {
alert('1');
}
};
} ();
When I load Index.aspx, the Init() function in Index.js is fired twice, so I see 2 alerts one after another. If I assign a click handler to a button inside the Init() function and hit the button with FireBug, it is actually showing 2 events being assigned to the button. Why is this happening?
Thanks!
(Let me know if I need to provide more info. As I said, I'm new with Telerik)
EDIT: Some more firebuging and I figured out that both calls to ScriptRegistrar are being rendered. How do I make only master one to render?