Best way to learn Ext JS for use with ASP.NET? - asp.net

I have very basic knowledge of Javascript and now I am looking forward to learn Ext JS and implement in in my ASP.NET application.
If anyone can guide me on how to start and which book I should follow, I'd be thankful.

Nor sure if it is the quickest approach, but all I did (as well as another developer that was working with me) was review the ExtJS documentation and samples gallery (and viewing their source).
One big issue to watch out for when using ExtJS with ASP.NET is that when using BorderLayout you will go crazy trying to figure out why Postbacks no longer work. There is a workaround though.
Another ASP.NET gotcha is that if you use ExtJS to talk with ASP.NET web services (or WCF) you have to do some special things to get it to work (adorn your webmethod with special attributes, or add some things to web.config, etc).
Those were the only two gotchas I can recall, other than just learning and getting the hang of ExtJS itself.

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.

Coolite equivalent for jquery?

Does anyone know of a well-supported ASP.NET wrapper for jquery (much like the way Coolite works for ExtJS)? I have a lot of ASP.NET web forms experience and really don't like writing javascript. I've found working with raw jquery in the web forms model to be difficult (especially when dealing with animations and handling postbacks).
If not, I'll probably just dedicate myself to Coolite!
jQuery already ships with ASP.Net MVC these days. Have you looked into that? Not sure that it "wraps" the jQuery API per se vs. being used under the hood (I'm not sure, I don't use it).

Should I learn ASP.NET if I prefer to have fine-grained control over my site's HTML?

For months, I've been considering downloading Microsoft's express web platform and learning ASP.NET, which I might actually enjoy, seeing as I already do web work with PHP, but am much more comfortable with C#.
However, the primary reason I don't want to do this is that I've always associated ASP.NET with useless spaghetti HTML. The link I posted is an excellent example. Would it be possible to use ASP.NET in a context more similar to PHP, using it to power my site but not leaving the HTML, CSS, and JavaScript to be done by hand for validation and semanticity reasons?
EDIT
I've decided I'm not going to learn ASP.NET and stick with PHP.
While MVC sounds nice, for me it will likely end up being a development/debugging headache.
Things get much better if you use ASP.NET MVC. I recommend you skip ASP.NET WebForms and jump to MVC directly.
If you are going to use Classic ASP.NET Web Forms, you really need to learn how it works to avoid truely ugly html. If you know what you are doing, you can get close to what you want (you can't completely get rid of ViewState & it will do some ugly thing with element IDs)
A lot of the ugliness of Classic ASP.NET occures when people write web forms like they wrote VB 6 Windows applications.
ASP.NET MVC is a good option. It may be the way to go as a starting point; I would like to switch to it myself. I guess my point is that you can get less ugly HTML using Classic ASP.NET.
you're really going to want to check out the asp.net mvc. it allows you to develop in a manner a lot more suited for the web than vanilla webforms.
First of all, ASP.Net, even using webforms, does allow you to have complete control over the markup output. Of course it's easier for some cases than others, but anywhere you find you're not getting the html you want out of a control you can always replace the render behavior with a ControlAdapter.
That said, as others have mentioned you'll probably find it's much easier to get the exact html markup you want using ASP.Net MVC.
MVC.net and WebForms are built upon ASP.net
You can get a decent amount of control with webforms by disabling viewstate and not using any controllers (or very few). Its all in how much you let it do for you
If you are looking to acquire skills in the latest and greatest, then MVC is where you should start but I would also consider whether you will ever be asked to support ASP.Net Webforms. Having an understanding of ViewState is crucial to that end.
For fine grained HTML output, you can produce this in many different ways with classic ASP.Net. There is a growing group of developers who are using a mixture of ASP.Net and microtemplating with Javascript to produce RIA's. This inevitably leads to keeping your html output cleaner so that it can be manipulated with jQuery and CSS.
Learn ASP.NET MVC as it will give you more control over the html generated. Also learning ASP.NET will increase your job opportunities significantly.
My first real development in ASP.NET was with MVC, and I must say I truly miss it now that I'm onto the next project using webforms. Each has it's place and webforms is working pretty well for what I'm doing (also using it as an opportunity to learn about TableAdapters and what not) but I really do miss being able to insert the data I need right into the HTML. That way I know the layout I've built won't get screwed up.
As a framework I enjoy ASP.NET quite a bit, but the controls on the page seems so far removed from anything resembling HTML that there is often a mental disconnect with what I'm typing with what I'm expecting to see. I was that way when I first started HTML though, so I imagine I'll get used to it. When I started with MVC it was overall a much more enjoyable experience coming from a front-end background.

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.

Seeking advice on de-bloating asp.net 3.5

I’m new to .net, though I’ve been writing in classic asp for years. I know it’s time to make the change, but I can’t stand how bloated the HTML becomes.
For example, a simple menu using a web.sitemap and adds over 100 lines of JavaScript and HTML. A simple form with server-side validation adds in masses of ugly JavaScript. And a basic table of data using GridView adds in a ViewState that makes my eyes water.
Call me a purest, though I don’t like sending data to the browser unless it’s needed. And I don’t need a form-riddled menu when a simple unordered list of links will suffice.
So, set in my ways, am I destined to forgo the benefits of the Framework entirely by insisting on writing my own, cleaner code for everything? Or am I missing the point?
As a brief aside I’m a big fan of Campaign Monitor, a newsletter distribution company. They’ve written an elegant and comprehensive user-interface in .net without a single ViewState or bizarre .net-mangeled ID reference. Even the Sign Up form on their website (/signup.aspx) is as clean as a whistle. What’s their secret?
I hope I not the only one. Any advice would be greatly appreciated.
Try ASP.NET MVC or one of the other MVC web frameworks for .NET
If your GridView doesn't need it, then turn ViewState off for it.
Also, please edit your question to say what version of .NET you're using. Some of this gets better, and some does not. You might also want to try VS2010 beta 1, and complain about anything it doesn't fix.
Another idea would be to go on treating ASP.NET like it's classic ASP. Do it exactly the way you're used to, but do it with the idea in mind that there's about 10 years of development work that's gone into solving some of the problems of classic ASP. Once you actually hit one of those problems, find out if ASP.NET has solved it, and how.
For instance, I have a hard time believing you enjoy writing FOR loops to generate table rows. If you get tired of that, learn to use a Repeater control, or a DataList control, or even the old DataGrid control. If you turn ViewState off on those, I think you may find the generated HTML to be acceptable, and you'll find it a lot easier to generate tables and other structures that repeat based on repeating data.
You can opt-out of much of that bloat by not using all the out-of-the-box controls that come with it but I prefer the MVC route that activa suggested
Here is my list:
Keep the use of asp controls to minimum
Turn off Viewstate when it's not need
If you don't want the JavaScript associated with Client Side Validation (with ASP.NET Validation) set the EnableClientScript to False
Use asp:literal instead of asp:Label
Yeah it seems to be that everyone is bashing webforms at the minute for the reasons you have outlined above. HTML heavy Controls, ViewState, no control over ClientIDs all seem to cause an issue with people.
However let is be said that you can use asp.net (webforms) and produce some decent applications.
Control of html is yours through httpModules and httpHandlers and some of the issues mentioned above are fixed in asp.net 4.0
I just listened to a great podcast comparing MVC and webforms. Its in the area you are asking about. Also check out this blogpost by a dotNetNuke regarding the good asp.net code and why people should take a breath before converting everything to mvc.
Having said that I've tried Asp.net MVC and it is awesome. I'd probably look at dotNetNukes code to as its a mature asp.net product.
Also, when you do want to use these newfangled server controls, check out the css friendly control adapters. They clean up much of the bloat.
For client IDs the key thing to remember is to let the framework handle them. If you need to get an element on the client side, remember to emit the control's ClientID property into your script.
I've been using a template system and am very happy with it. Basically write an http handler for .html files and put tokens in the html files that regex could find in one sweep and inject any stuff. (google template c# for more info).
I tried some of the supposedly cool new features of ASP.NET for a little while. I also didn't like most of them. I felt constrained to work within the limitations of the common paradigms Microsoft had dreamed, even though I new how easy it would be to produce the HTML and JavaScript myself to do specifically what I wanted to do without having to learn how to jump through the hoops of so many new Microsoft-specific idiosyncrasies.
Anyway, I stopped using the parts of ASP.NET I didn't like on new code I've been writing lately. When I first started using ASP.NET, nothing in the MSDN documentation jumped out at me about how to avoid such complications, so I posted a couple "Hello, World" at http://www.agalltyr.com/rawaspdotnet.html to help spread the heretical word. I couldn't care less if it's the latest cool technology or the recommended technique. It's a reliable and reasonably efficient tool I can use to do my work.
Oh, and I'm not in the mood to learn ASP.NET MVC either. That's just more idiosyncrasies. Give me a language (C#) and a framework (.NET), and I'll design my own abstraction, thank you.

Resources