网页中的 Html 助手(来自 asp.net mvc)
是否可以在网页(cshtml)中使用 MVC Helpers?
我正在尝试一些来自 infragistics 的控件,并且想使用 html 帮助器方法来创建网格(避免一些 JavaScript),但我似乎无法获得任何智能感知。
不,我不确定它是否有效?
更新:我想使用以下行:
@Html.Infragistics().Grid(....
在我的 MyWebPagesPage.cshtml 中
感谢您的帮助
Larsi
Is it possible to use MVC Helpers in webpages (cshtml) ?
I'm trying out some controls from infragistics, and would like to use the html helper method to create the grid (avoiding some javascript) but I can't seem to get any intellisense.
No, I'm unsure if it should work?
Update: I want to use the following line:
@Html.Infragistics().Grid(....
inside my MyWebPagesPage.cshtml
Thanks for any help
Larsi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够,只需添加
@using infrajistics.namespace
您还可以将命名空间添加到您的 web.config 命名空间部分,这样您就不必在每个视图中添加 @using
You should be able to, just add
@using infrajistics.namespace
You could also add the namespace to ur web.config namespaces section so that you don't have to add the @using in each view
没有可以渲染 Infragistics 控件的辅助方法。请查看 此页面,有MVC页面中使用Infragistics控件的详细说明。
但也有一些限制。 Infragistics 没有单独的 MVC 控件,他们只是提供了 asp.net 控件,但有一个缺点。
示例用法如下:
不涉及 MVC 帮助程序。
There are no helper method that would render Infragistics controls. Please take a look at this page, it has detailed instructions of using Infragistics controls in MVC pages.
There are some limitations though. Infragistics doesn't have separate controls for MVC, they are simply making their asp.net controls available, but there's a drawback.
Sample usage would be:
No MVC helpers involved.