在MVC应用程序更改脚本文件夹,并使用Telerik的MVC扩展 [英] Changing scripts folder in MVC application and using Telerik MVC Extensions

查看:143
本文介绍了在MVC应用程序更改脚本文件夹,并使用Telerik的MVC扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Telerik的MVC扩展,并动了我的脚本文件夹中的内容文件夹。因此,而不是...

I am using the Telerik MVC Extensions and have moved my Scripts folder in to the Content folder. So instead of ...

    <script src="<%= Url.Content("~/Scripts/jquery-1.4.1.min.js") %>" type="text/javascript"></script>

...我现在有...

... I now have ...

<script src="<%= Url.Content("~/Content/Scripts/jquery-1.4.1.min.js") %>" type="text/javascript"></script>

我知道我可以关掉jQuery的包容与 ScriptRegistrar()。jQuery的(假)方法,但我如何告诉Telerik的MVC扩展,其中新的基地文件夹?

I realise that I can turn off jQuery inclusion with the ScriptRegistrar().jQuery(false) method, but how to I tell the Telerik MVC Extensions where the new "base" folder is?

推荐答案

您无法通过API设置的的文件夹 ,你要么遵循MVC公约或插入手动脚本。你当然可以,编辑扩展的code和修改其中 ScriptRegistrar 寻找他们的地方,在<一个href=\"http://www.telerik.com/help/aspnet-mvc/allmembers_t_telerik_web_mvc_webassetdefaultsettings.html\"相对=nofollow> WebAssetDefaultSettings 类。

You cannot set a base folder through the API, you either follow the MVC convention or you insert your scripts manually. You can, of course, edit the code of the extensions and modify the places where the ScriptRegistrar looks for them, in the WebAssetDefaultSettings class.

这是说,你真的需要在内容文件夹中的脚本?

That said, do you really need the scripts in the Content folder?

这篇关于在MVC应用程序更改脚本文件夹,并使用Telerik的MVC扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆