Kennethvr
Kennethvr

Reputation: 2680

is jQuery the best way of dealing with user interaction in C# .net environment?

I'm wondering, .net has all these build in GUI elements. The purpose is that we build a .net web application and for the coding itselve I know my way. But as for user interaction, ajax, etc..

I'm very familiar with jQuery in PHP but I noticed that in .Net everybody starts using it too.

Is jQuery the best way these days to deal with this in .NET (c#)? or are there others you might recommend?

Upvotes: 2

Views: 222

Answers (5)

Patrick Karcher
Patrick Karcher

Reputation: 23603

.Net web controls can be very powerful and can quickly provide good, professional user experience. But there are tradeoffs:

  • You have less control ultimately over your markup
  • You have to learn the quirks and limitations of various controls
  • Before ASP.Net 4.0, it was sometime tricky to have your control-markup work with javascript (and javascript libraries such as JQuery) and CSS, because when rendered they sent to the client some crazy html.

In short, .Net web controls are not the best strategy for every situation, although in Asp.Net 4.0 they are less troublesome. In 4.0 you can make the mark-up they send to the client more predictable, including more control over the id attribute.

And of course there is the other option in ASP.Net: the MVC framework. Although WebForm strategies now work better with JQuery, MVC is fundamentally more of a hands on approach to your markup, which works fantastic with a JQuery heavy strategy. For this reason, you'll see JQuery more in MVC apps than in web forms applications.

MooTools, Prototype and others are also more effective than they were before in .Net, but JQuery is arguably best in .Net because:

  • It has been given the microsoft blessing, ensuring there won't be any fundamental compatibility problems.
  • Included in MVC projects by default, MVC (and traditional WebForms to a lesser extent) will increasingly be developed with using JQuery in mind.
  • Because of the two above, there is a snowballing effect: when looking for guidance and examples online, it easy very very easy to find helpful examples of JQuery being used with .Net. It's difficult to find examples of other javascript libraries being used with .Net.

We should all use our strengths. If you've got JQuery expertise, that expertise will translate very well to .Net, especially if you're using MVC or the newer WebForms. And besides, JQuery rocks!

Upvotes: 4

Chris Kooken
Chris Kooken

Reputation: 33880

Definately a subjective question, but i'd say JQuery has become one of the standard client libraries for .net. Especially MVC as they play very nicely together. You have JsonResults that just seem to mesh so nicely with JQuery in asp.net MVC.

They syntax is very elegant, and most .net shops have adopted it unless they have a lot of legacy code. I would recommend moving forward with it ESPECIALLY if you already know it.

Upvotes: 2

Retired_User
Retired_User

Reputation: 1595

In software development there's no "best" solution. There is the solutions that "fit" your needs and the solutions that don't. jQuery has been largely adopted, and fit most needs with practical markup/syntax.

If it fits your meeds, why not use it?

Upvotes: 0

J.T.
J.T.

Reputation: 2616

"The Best" is always going to be a matter of opinion. Microsoft got behind jQuery with the release of Studio 2010. I think, think, think they are even a sponsoring partner and offering development/funding support for jQuery.

In my opinion, if you need to abstract low level javascript programming, then jQuery is the way to go. If you need widgets, there is a great community and jQuery's UI is a great start. However, there are always alternatives. It just depends on how robust we're talking. For instance, EXT works for data heavy web applications much like Flex using actionscript. However, you wouldn't really use it for a typical website (another opinion!).

Upvotes: 0

kemiller2002
kemiller2002

Reputation: 115498

Really, any of the frameworks will work with .net. Jquery is a popular one among the .net groups, but not the only one.

For example, here is a .net wrapper for yui controls: http://yuidotnet.codeplex.com/

Upvotes: 1

Related Questions