JQuery or Any other Java Script Lib. for Developing Web application - asp.net

Recently i completed on mid level web application where i have used telerik controls,
all the developers in project used native javascript functions as well as telerik
functions to work with javascript.
We faced so many cross browser issues in this approach, we have solved all the issues but i am just wondering that what should be the best approach ?
Do i need to consider JQuery for the next project for avoiding cross browser issues or there is any other option
I want my application should work perfectly in (IE 6+, FF 2+ & Chrome)
Please suggest the appropriate solution.

I prefer using jQuery. It helped me lot to develop rich applications without writing code that target each and every browser.
Also I found their documentation to be relatively simple and have a large user base which is quite an advantage for a library. Also there are plenty of plug ins that are built on top of jQuery.

If you are doing trivial amounts of JS, then a framework is usually going to be more bandwidth than it is worth. (It doesn't sound like you are, but I think it is important to get that statement out of the way first).
Once you get into serious amounts of JavaScript, then it is worth looking at the various frameworks out there.
jQuery is popular. I prefer YUI. I've heard good reports about ExtJS for projects described as "web applications". There are a number of other popular choices.
It is worth evaluating which best suits the sort of projects you are working on.

I used telerik controls in the past, and I have to say that they are quite a pain in the butt. They are very rigid and don't allow you any control. I have found that YUI provides you with a solid javascript framework that has all the features telerik offers, but with non of the limitations.
Check it out here

Most people here will suggest you use jQuery. I would suggest you sketch out your requirements and priorities before starting development on your next project and evaluating libraries based on your list of requirements. Using any large general purpose library such as jQuery or Prototype will have implications (download size/delay for user, code quality, trade-offs between generality and speed) you should be aware of before using them.

as most have already posted, it all depends on what you need to do, i used jQuery, script.aculo.us, and Mootools for some time, and for lightweight effects mootools was the most appropriate, as for support and medium sized projects jQuery. script.aculo.us is pretty usefull as it is based on prototype, but it took me some time to figure out how to actually use it effectively

I personally prefer JQuery and ASP.NET AJAX (Microsoft AJAX Library). There are so many JQuery Plug-in available which you can try them out. As for ASP.NET platform, Microsoft AJAX Library is inevitable because of its simplicity and tight integration with ASP.NET controls. Recently, JQuery has attained citizenship in Visual Studio 2008. This should also be taken into account.

Related

Is there something equivalent to PrimeFaces for ASP.NET?

I'm being a ASP.NET developer over years but recently I started to work with some PrimeFaces solutions with JSF 2.0. I haven't nothing to complain about it.
It is worth emphasizing a few points that did ​​me likes the PrimeFaces: many components, easy to use, fully based on jQuery and jQuery UI (which are very important to me) and very focused on web standards (even more important to me).
But there are some cases that I would really want my server-side with ASP.NET. I don't want to start a discussion here about advantages between JSP and ASP.NET, both has many motives to be used.
Well, the standard ASP.NET components aren't jQuery based, aren't themable with jQuery UI Themes, aren't fully based on web standards (a big problem) and the variability is much more simple (there aren't Carousel, Accordion, Captcha, Slider, Spinner, etc, etc, etc).
EDIT
Continuing the saga, the #Raynos answers inspired me to study lighter possibilities, like the suggested manos. But I really would like something a little more automated, at least in the HTML generation for common controls. Someone known working CRUD samples for manos or additional modules supporting this task?
Recalling that the main question is still open anyway: Do you know any UI Framework for ASP.NET based on the same ideas of PrimeFaces, prefered open-source like it is?
I suppose we cannot answer your question with something simple. As showed by other answers, unfortunately we don't have in ASP.NET any UI framework fully web standards based.
You surelly have that choice about not using ASP.NET but another .NET Framework based engine. I really think that ASP.NET MVC would be the more closest to JSF and so to PrimeFaces. But it haven't a large set of builtin controls based on jQuery as you liked on PrimeFaces. Also, if you only used up to now the vanilla ASP.NET, the MVC concept can be very confusing to start through a professional project.
It may be safer to continue with your technology knowledge while learning something totally new. Even so I don't indicate manos to your project, although it shows to be very light and stable. Furthermore, with it you would need to "recreate the wheel" for many tasks that ASP.NET knows to do well within the standards and such.
Based on these arguments, it seems that in your case you (or your team) is so familiar with ASP.NET that your immediate need is to use good tools to improve the shortcomings of ASP.NET on HTML5, web standards and themes. Then you don't need to change everything you knows right now, just improve what you already know (and of course we recommend that you consider these other approaches gradually).
So let a few helpful hints for you:
First read about and download a sample of a good architecture using HTML5, jQuery and jQuery UI. This post covers all those technologies and have the full source code to download.
Also have in mind that you don't need start your project from scratch. There is the great HTML5 BoilerPlate which comes with dozens of good pratices (and a nice Web.config created with many nice ideas). Important note that it's also based on jQuery as you want.
Maybe you already have some incredible themes created for PrimeFaces and you would like to use on your ASP.NET projet. Then remember: to take advantage of the jQuery UI Themes you just needs using class names and DOM hierarchy. If your PrimeFaces Complex DataTable gerenates an incredible HTML which is so beautifull with your CSS, just use the same generated HTML inside a UserControl so you can reuse it around all yours pages without needing rewriting all the HTML.
Also remember that PrimeFaces is opensource and because of it you always can open the sources, read the jQuery codes and reuse what you really think are perfect for you.
Then, finally, there are many tools and approaches to support you enjoy what you've done with PrimeFaces and also enjoy your existing knowledge in ASP.NET. Unfortunately we don't have done something like this to ASP.NET, but maybe what you'll do will be so good that you can publish opensource for everyone?
PrimeFaces for ASP.NET is announced. http://blog.primefaces.org/?p=2128
Sounds like you need ASP.Net MVC instead of ASP.Net Web Forms, this gives you much more control.
You have the asp.net mvc html helpers toolkit, see: http://weblogs.asp.net/gunnarpeipman/archive/2010/08/16/asp-net-mvc-meets-html5.aspx
I'm not aware of great open-source .NET integrated UIs, but Telerik RadControls are themeable (sp?), standards compliant, integrated with ASP.NET, and built with jQuery. They are really great if you have a few hundred dollars to burn.
Otherwise, AjaxControlToolkit is integrated with ASP.NET and open source but I'm not crazy about it. It's not based on jQuery but I think it is standards compliant.
Sadly, the open source communities tend to shy away from .NET (and Microsoft in general).
PrimeFaces For .NET Cancelled
PrimeFaces for ASP.NET WebForms project has been cancelled after two releases and as PrimeTek we have decided not to do further investments. Instead of .NET, our secondary focus will be PrimeUI who is very close to 1.0 release already and can be used with any web framework.
You can check out the PrimeUI library which is:
a collection of rich javascript widgets based on jQuery UI. PrimeUI is a spin-off from the popular JavaServer Faces Component Suite, PrimeFaces.

Maintainability: jQuery or the Ajax Control Toolkit?

My team is currently working on a substantial update to an existing ASP.NET 3.5 application which uses the Ajax Control Toolkit on virtually every page. We've found that in many cases that its use is unwarranted (clearly a previous developer decided to "Ajaxafy" everything), and a richer - and simpler - experience can be found using jQuery.
We've also found that the AjaxControlToolkit can be a pain to work with frankly in terms of maintainability and performance when you have half a dozen developers working it. We're debating scrapping its use completely, and going with jQuery for the UI experience. We're fortunate to have enough time to do this safely, and every feature we use can be replicated without any problems (AutoComplete, Calendar Control, etc).
It seems Microsoft are siding with jQuery with its addition to Visual Studio lately, and the current Ajax Control Toolkit isn't in ASP MVC (client side files only). Therefore I'm personally siding with jQuery for the moment, as it seems to have a future, while the Control Toolkit's future is a little more cloudy.
However, from a maintainability perspective, how is jQuery to work with?
It's essentially just Javascript, so no plugins required. Are updates stable, and do they often break existing functionality?
We use jquery extensively with asp.net 3.5 and have upgrade jquery and jquery ui about 3 times without a hitch. Both times we have had noticeable speed increases. Maintenance has never been an issue in about 2 years of use with 5 developers.
We find jQuery very readable and enjoyable to code with.
Don't give up on AJAX just yet. Both AJAX and jQuery are useful as long as you're using them to do what they're suited to. I really don't see too much of a difference in maintainability, it's all still code. You need to test new releases/updates before putting them into production; vet any 3rd party code you're integrating into your code base, and make sure that you're not using AJAX/jQuery to pound a square peg into a round hole.
As to the pros/cons of AJAX vs jQuery:
AJAX beats out jQuery when it comes to:
Server-Side integration
CLR Features and Feel
JSON and WCF
jQuery beats out AJAX when it comes to:
Animations
Being Lightweight
DOM Selection
Attribute / CSS Manipulation
The ACT isn't in MVC because the control structure is deeply embedded in the web forms product; most vendors (like Telerik, Component Art etc) are actually writing a separate code-base for MVC because of the complexity of making it work with two frameworks, although Telerik did a good job of it (you can use the web form controls in MVC, though the MVC-specific controls are much nicer to use).
I like JQuery, and for a project, I believe we are going to go Telerik/JQuery and plugins, so that is always a good bet.
Also, the ACT does have a lot of scripts and may not be applicable in all scenarios, but the real issue is adding too much AJAX when it isn't warranted, something that can be a problem with any other framework too.
HTH.
jQuery is tested pretty extensively. I don't remember a break caused by an update, you mileage may vary. They would likely know about any compat problems and warn about them in the release notes or elsewhere.

Do I need AJAX and ASP.NET for what I'm doing?

Easy question. I used to develop websites back in the days of "classic" ASP, and when I'm asked to do a quick and dirty website for family or friends now, I still resort to direct HTML/ASP and some basic CSS and Javascript - I can get the sites up pretty quickly this way. However, I've had a few requests to design and develop some sites for pay, and thought I should catch up on my web skills. I have been using .NET 3.5, XAML/WPF, etc. for Windows apps, so I'm up on .NET, I'm just behind on the web end.
To the question: If I want to design/code a site that looks identical on all (at least somewhat recent) browsers and platforms, should I be using ASP.NET and AJAX? There might be a little database activity on the site, but not much, so I don't need an enterprise level, multi-tier extendable architecture... just something that looks good and works on multiple platforms without having to code all variations for each browser. After looking at all the ASP.NET books at the bookstore, it seems they all focus mostly on data and postback stuff. Is it still a legit option to use some basic, boring html and javascript with some Flash embedded where needed?
Let me know if I need to clarify the question. Thanks for your advice in advance!
Your question is more loaded than you think, but let me try to address a few points that I think are relevant.
First, how a site looks is almost completely dependent on the HTML/CSS you use and how you code the front end of the site and only slightly dependent on the server technology. So if you want your site to function across browsers and platforms, learn to code following web standards, with semantic markup. (Search on those terms for more info).
Also, ASP.NET comes in two flavors now: ASP.NET MVC and normal ASP.NET. I highly recommend, if you are going to get into ASP.NET, that you follow the MVC platform. It closely follows similar technologies (like Ruby on Rails) and will make the transition to other MVC platforms easier on you. Also, the MVC platform doesn't try to output as much pre-made HTML as straight ASP.NET will when you use their "drag and drop" controls.
Secondly, it really depends on the sites you are building, but straight JS (or JS + jQuery), CSS, and HTML -- and please don't use Flash unless you are embedding a video -- will actually work for a number of basic sites. If you need some things to happen on the server, PHP makes for a great platform. If you are working with advanced database access, and program flow, and since you are already familiar with .NET, then stick with it... MS has some great tools and resources to help you out.
Finally, a lot of developers use a favorite CMS or blogging platform as the backend of simple sites that still need the ability to manage the content easily. Expression Engine (CMS) and WordPress (Blog/Lite-CMS) are often used (both PHP based) but there are tons out there.
Good luck stepping up your game!
I would recommend learning jQuery. This will give you a browser independent abstraction for your JavaScript.
ASP.NET controls will render it's controls in a browser independent way, but that doesn't mean your site will automagically be browser independent. You still need to know how elements are rendered differently in different browsers.
I'd also recommend using a CSS Reset sheet as a starting point for your CSS.
All in all, if you've been developing old school ASP, you'll probably really love ASP.NET as it will save you a lot of time and looping. You may want to jump right in to ASP.NET MVC too.
To the root of your question, I'd learn ASP.NET if you're doing anything more than a simple brochure site. If you have .NET experience, and classic web development experience, then learning ASP.NET is not going to be a big hurdle and will be well worth the effort.
I agree with Aaron Daniels' answer about learning jQuery. jQuery helps a lot with cross-browser compatibility in JavaScript and some CSS-based effects.
However, you should also look into ensuring your site uses well-formed, valid HTML, and doesn't use too many CSS 2+ features. This should ensure that your site is standards compliant, which will mean it will play well with Firefox, Safari, Opera, and even later versions of IE to an extent. You will still need to do manual tweaking for IE - it's been too broken for too long for MS to be able to fix it properly in one go - so look into conditional comments for applying a separate stylesheet for IE users.
AJAX is a handy technology for "desktopifying" your web app. It provides a mechanism for asynchronous callbacks to the web server, so you can pass data to and fro without reloading the page in the browser window. This is how the voting buttons work on StackOverflow, for example.
Lastly, ASP.NET doesn't really have much effect on the end user's experience in terms of the look and feel of the site. It is a server technology that provides for writing complex applications to be delivered over the web to a browser. Having said that, MS have put in some extra goodies to make working with AJAX a little easier.
Hope that helps!

Feeding .NET MVC Views the jQuery UI way

I've seen a few blog posts and tutorials overviewing mixing in jQuery and the UI elements for Views in a .NET MVC web app. But usually targeted at developers with a comprehensive grasp of the full dev cycle and variations of back/middle tier technologies.
As the front end developer I'm pitching a jQuery-only UI to the back-end dev - he cautions against a non-webforms interface for sake of the code maturity pov.
I'm trying to hit back with "well...it's your pattern ...isn't it elemental to MVC? No logic in the view? I'm reading that to be 'server-side stuff'. You just serialize the properties i'm asking for, or better...let me easily discover what you _can send me...i'll be able to implement the UI via jQuery UI."
So how valid is my position?
Can jQuery's grid be expected to handle at least the bottom 85% of .net's native control (low-to-moderate capacities # of rows)?
How about in-line editing? ...from the grid?
Would working exclusively in Web Services simplify his life at all? and if so, wouldn't that be logical way to build a .net-to-jQuery relationship? - ajax liaisoning twixt server (.net WS methods) and client?
mny thx
--steve...
Don't fight the platform. That way lies pain and suffering.
The MVC view objects are vastly different than asp.net webforms with server controls--you get straight up html. You get jquery and ajax basically for free, with (almost) magic server side ajax call processing.
They are designed to do what you ask. Writing your own jquery ui is reinventing the wheel.
Not only would it be a ton of extra work for no gain. You would be the only developer around trying to do that, and when you needed help, few could offer advice.
If this is an admin interface, and the client has agreed that users must have javascript enabled then I think using javascript to build widgets on the page is a better option than using the asp.net server controls. If however this is a public facing website I would argue that a pure html and css approach is much better, and then use javascript to progressively enhance the page!
Now I dont ever advocate using asp.net server controls, because they spit out poor markup and they are overly complicated to use. Instead I have been using jQuery to do the grunt work and dom querying and traversing. I also dont advocate using jQuery UI because they are missing some very essential widgets, for example no datatable, no treeview etc. I know that there are lots of plugins for jQuery but they are not componentised and therefore each plugin needs to reinvent the wheel to achieve everything it needs. Once you have included all your plugin libraries and css you often end up with a very large page footprint. Also each plugin often has a different home page and documentation that may or may not be up to scratch.
I think that the best UI library is YUI, and you can easily combine it with jQuery. Because each widget is made up from core components the overall weight of download is smaller. Also you have all the documentation in one place with 100's of working examples. Also it means working with the same set of javascript patterns across the board, so with each widget you learn more and more about the library. Hopefully jQuery UI will catch up, but personally I am looking forward to YUI 3 which for me might mean dropping jQuery altogether...
jQuery is a very mature library. It is used by thousands of people across the internet, and I dont think I have ever encountered a bug. YUI is dogfooded by YAHOO so it too is battle hardened.
One thing I did not mention to you is that I am using the default webforms view engine with asp.net mvc. I think it is still the best option as you get intellisense and also Resharper refactoring even searches your views, and the static solution anaylsis can find code errors in your views.
For building my markup I have been using MvcContrib Fluent Html but you could also checkout this article that advocated the DRY principal very well.

Creating a drag and drop application in ASP.NET 3.5

I need to make a client able to drag and drop images into category-folders in an ASP.NET 3.5 web-app.
I was hoping that an option existed, that was almost as easy to use as the Reorderlist from Ajax Control Toolkit, and where I did not have to look into JQuery or similar handcoding.
What are your recommendations?
Similar questions have been asked before, like this 6 months ago...: ASP.net AJAX Drag/Drop? where MooTools is recommended, but 6 months is a long time in the ASP.NET/Ajax world, so maybe a better and even simpler option exists now?
Commercial components are also an option - well up to 200$ anyway.
My experience with the Reorder List in the Ajax Control Toolkit, as with many other 3rd party providers, is that most of them don't seem to be worth the effort. Definitely try them before you buy.
Unfortunately a lot of the samples/components out there are all too client-based and always seem to fall short on real-world uses and the sorts of interaction you need with ASP.Net applications (e.g. handling postback). Dragging a div around isn't that complicated, but that's all a lot of examples do. If your needs don't exactly mirror their offering try something else.
The Manning book ASP.NET AJAX in Action is a good reference on code for performing drag and drop. It uses Microsoft.Web.Preview, but this hasn't been updated in quite some time which is a worry. I have created a pretty good drag and drop UI with MS's PreviewDragDrop, it does work cross-browser, and it's pretty easy to code. Preview DLL's aside, the Manning book is great for understanding Microsofts AJAX API.
However, since jQuery is going to be shipped and supported with Visual Studio, I would recommend using it over anything else in a vain attempt to future-proof yourself.
A final piece of advice is never outsource your core competency. If this page is a core part of your offering you're better off implementing it yourself using library code like jQuery or Microsoft.Ajax rather than relying on a 3rd party component. However, if it's just a minor part of your site, then go ahead and use 3rd party controls.
Ref: My Version of Microsoft.Web.Preview.dll is 1.1.61025.0.
i have been very very happy with telerik's treeview control and use it for almost any asp.net application which needs a treeview drag and drop.
they allow free development licenses (not production though) so i guess you should give it a try. go to www.telerik.com and have a look
This is another Mootools suggestion, but you might find the Mif.Tree plugin useful. It's an MIT license. There are also code examples for each of the demos and API docs.
Robert>>
After spending 4-5 painful days of hacks, double-hacks and hacks to get around other hacks, I have come to the same conclusion as you. Especially the reorderlist from the ajax control toolkit drove me to the very edge of insanity.
It seems to me there is no real way around learning JQuery and simply doing the stuff myself. I used to shy away from doing client-side code, but with AJAX so much code has moved away from being just serverside.
JQuery has just been moved to the top of my personal study program.
Jquery has drag and drop controls.
Link
Maybe that will help...

Resources