ASP.NET MVC和Ajax控件工具包

时间:2022-11-06 16:27:37

One of the things I like about coding "old skool" (web forms) is the AJAX Control Toolkit.

我喜欢编写“旧skool”(Web表单)的一个方面是AJAX Control Toolkit。

I saw on the Microsoft Storefront video 14, Rob Conery uses the TextboxWatermark control.

我在Microsoft Storefront视频14上看到,Rob Conery使用TextboxWatermark控件。

When I downloaded the code though, I couldn't find any reference to the Watermark control or any other control from the toolkit nor could I get it to work.

当我下载代码时,我找不到任何对Watermark控件或工具包中任何其他控件的引用,也无法让它工作。

So my question is, does the AJAX Control Toolkit even work in an MVC / AJAX / JQuery type world without viewstate. What do you use for "simple" controls such as Calendar & Watermarks?

所以我的问题是,AJAX Control Toolkit是否可以在没有viewstate的MVC / AJAX / JQuery类型世界中工作。您如何使用“简单”控件(如日历和水印)?

3 个解决方案

#1


8  

jQuery UI has a calendar and other UI components. Also check out the vast number of jQuery plugins.

jQuery UI具有日历和其他UI组件。另请查看大量的jQuery插件。

#2


2  

I've been looking into this question recently and what I've found is that the AJAX Control Toolkit is not easy to use in the "JavaScript only" manner that you'd want to use for ASP.NET MVC. In fact it's a real pain. Here are two examples:

我最近一直在研究这个问题,我发现AJAX控件工具包不容易以你想要用于ASP.NET MVC的“仅JavaScript”方式使用。事实上,这是一个真正的痛苦。以下是两个例子:

Example 1 - Popup Calendar

示例1 - 弹出日历

Example 2 - Auto Complete Text Field

示例2 - 自动完成文本字段

Neither are easy.

两者都不容易。

You can give your MVC pages a code-behind and use the AJAX Control Toolkit as you would in regular ASP.NET, but that really violates the whole idea of MVC, so I wouldn't advise it.

您可以像在常规ASP.NET中那样为MVC页面提供代码隐藏并使用AJAX Control Toolkit,但这实际上违反了MVC的整个概念,所以我不建议它。

My suggestion would be to follow Fredrik Kalseth's advice and use jQuery UI or one of the many plugins. Telerik also has some good looking Open Source MVC Controls that are based on jQuery.

我的建议是遵循Fredrik Kalseth的建议并使用jQuery UI或众多插件中的一个。 Telerik还有一些基于jQuery的好看的开源MVC控件。

#3


0  

Most of the AJAX Control Toolkit is available in MVC-friendly javascript form off the MS AJAX CDN. These can be used using a jquery plug-in syntax as well.

大多数AJAX控件工具包都可以在MS AJAX CDN中以MVC友好的javascript格式提供。这些也可以使用jquery插件语法来使用。

#1


8  

jQuery UI has a calendar and other UI components. Also check out the vast number of jQuery plugins.

jQuery UI具有日历和其他UI组件。另请查看大量的jQuery插件。

#2


2  

I've been looking into this question recently and what I've found is that the AJAX Control Toolkit is not easy to use in the "JavaScript only" manner that you'd want to use for ASP.NET MVC. In fact it's a real pain. Here are two examples:

我最近一直在研究这个问题,我发现AJAX控件工具包不容易以你想要用于ASP.NET MVC的“仅JavaScript”方式使用。事实上,这是一个真正的痛苦。以下是两个例子:

Example 1 - Popup Calendar

示例1 - 弹出日历

Example 2 - Auto Complete Text Field

示例2 - 自动完成文本字段

Neither are easy.

两者都不容易。

You can give your MVC pages a code-behind and use the AJAX Control Toolkit as you would in regular ASP.NET, but that really violates the whole idea of MVC, so I wouldn't advise it.

您可以像在常规ASP.NET中那样为MVC页面提供代码隐藏并使用AJAX Control Toolkit,但这实际上违反了MVC的整个概念,所以我不建议它。

My suggestion would be to follow Fredrik Kalseth's advice and use jQuery UI or one of the many plugins. Telerik also has some good looking Open Source MVC Controls that are based on jQuery.

我的建议是遵循Fredrik Kalseth的建议并使用jQuery UI或众多插件中的一个。 Telerik还有一些基于jQuery的好看的开源MVC控件。

#3


0  

Most of the AJAX Control Toolkit is available in MVC-friendly javascript form off the MS AJAX CDN. These can be used using a jquery plug-in syntax as well.

大多数AJAX控件工具包都可以在MS AJAX CDN中以MVC友好的javascript格式提供。这些也可以使用jquery插件语法来使用。