开发者

How to create telerik mvc windows programmatically

There is a command like this that I'm using:

var windowElement = $.telerik.window.create({
title: "Insert image",
html: "<strong>Inserting an image...</strong>",
contentUrl: '',
modal: true,
resizable: false,
draggable: true,
scrollable: false,
onClose:开发者_高级运维 function() {}

});

But this give me an error saying that $.telerik.window is undefined.


In order for the Telerik javascript files to be loaded you will need to include the Telerik ScriptRegistrar at the end of your master page.

Checkout the following article: Telerik Extensions for ASP.NET MVC Manual

Looking specifically at the following section:

The ScriptRegistrar should be placed after all components on the page. Typically you could put the ScriptRegistrar component at the end of the master page.

The ScriptRegistrar searches for the Telerik javascript files in certain locations:

The ScriptRegistrar component looks for JavaScript files in the following order:

First it will search for a folder with the same name as the version of the Telerik.Web.Mvc.dll assembly located in the Scripts folder of your ASP.NET MVC application. If such a folder is found the ScriptRegistrar will look for the following extensions:

*.debug.js

*.min.js

*.js

If there is no such folder, the ScriptRegistrar will search in the Scripts folder of the ASP.NET MVC application. It is better to copy the folder with the version for easier upgrade.

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜