views:

2894

answers:

4

Hi,

I'm trying to get my head around MVC + AJAX etc.

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

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

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.

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?

Thanks!

+3  A: 

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

Fredrik Kalseth
+1  A: 

i want to ask the same question also maybe this useful for you http://www.nikhilk.net/Ajax-MVC.aspx

A: 

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.

rtalbot
Are you sure? Maybe things have changed, but this question is specific to the Rob Conery MVC demos
Christian Payne
Well - now I'm questioning myself :D. But I think this is what you're looking for: http://ajax.microsoft.com/ajax/act/40412/extended/TextboxWatermark/TextboxWatermark.js. I believe these were only released late last year.
rtalbot
+1  A: 

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:

Example 1 - Popup Calendar

Example 2 - Auto Complete Text Field

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.

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.

grahamesd