Eliminate duplication in CSS with .less – a .NET HTTP handler
One of the frustrating aspects of working with CSS (one of many, actually) is the amount of duplication in a .css file. .less help to keep your CSS files DRY using 4 constructs:
- Variables
- Mixins
- Operations
- Nested Rules
An HTTP handler is configured to respond to requests for the .less files.
<httpHandlers>
<add type="dotless.Core.LessCssHttpHandler, dotless.Core" validate="false" path="*.LESS" verb="*"/>
</httpHandlers>
When a request arrives for a .less file it is the handler’s job to parse the .less file and transform it into standard CSS rule sets.
What’s new in ASP.NET 4 – Short Videos
#1 | ASP.NET 4 "Quick Hit" – Chart Control 2 minutes, 42 seconds
#2 | ASP.NET 4 "Quick Hit" – Dynamic Metadata 5 minutes, 37 seconds
#3 | ASP.NET 4 "Quick Hit" – Permanent Redirect 5 minutes, 35 seconds
#4 | ASP.NET 4 "Quick Hit" – Imperative WebForms Routing 12 minutes, 39 seconds
#5 | ASP.NET 4 "Quick Hit" – Declarative WebForms Routing 14 minutes, 16 seconds
#6 | ASP.NET 4 "Quick Hit" – Outbound WebForms Routing 6 minutes, 18 seconds
#7 | ASP.NET 4 "Quick Hit" – Auto Start 11 minutes, 38 seconds
#8 | ASP.NET 4 "Quick Hit" – Clean Web.Config Files 2 minutes, 41 seconds
#9 | ASP.NET 4 "Quick Hit" – Predictable Client IDs 10 minutes, 47 seconds
#10 | ASP.NET 4 "Quick Hit" – Selective View State 6 minutes, 40 seconds
#11 | ASP.NET 4 "Quick Hit" – The HtmlEncoder Utility Method 5 minutes, 8 seconds
MVC or Web Forms? A Dying Question
Everyone who talks about ASP.NET MVC gets asked the question:
Should I use MVC or Web Forms?
There’s been quite a bit of debate on this topic, but in a couple years I don’t think it will matter.
and the stories continues here MVC or Web Forms? A Dying Question until …
The question in the next decade won’t be: “MVC or Web Forms?”.
The question will be: “MVC or SharePoint?”
But nobody will ask the question, because the answer is easier to figure out.
:>
ASP.NET MVC View Model Pattern
Evolve your ASP.NET MVC into ASP.NET MVC-VM
AsynFileUpload – from AJAX Control Toolkit
AsynFileUpload Control
The second new control included in the newest release of the AJAX Control Toolkit is the AsyncFileUpload control. You can use this control to display a fancier interface for uploading files. The AsyncFileUpload control:
- Enables you to perform file uploads without doing a postback
- Displays a throbber images while an image is being uploaded
- Raises both server and client events when a file upload completes or when there is an error.
- Works inside and outside of an UpdatePanel
Admit it! The standard file upload widget that you get with HTML is boring. You can’t display a picture while a file is uploading. And, it forces you to do a postback which is bad in this new Ajax world.
<asp:UpdatePanel ID="up1" runat="server"> <ContentTemplate> <h1>Add File</h1> File: <br /> <cc1:AsyncFileUpload ID="AsyncFileUpload1" onuploadedcomplete="AsyncFileUpload1_UploadedComplete" runat="server" /> <br /><br /> Description:<br /> <asp:TextBox ID="txtDescription" runat="server" /> <br /><br /> <asp:Button ID="btnSubmit" Text="Add File" runat="server" /> </ContentTemplate> </asp:UpdatePanel>
public partial class TestAsnycFileUpload : System.Web.UI.Page
{
protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
System.Threading.Thread.Sleep(5000);
string savePath = MapPath("~/Uploads/") + Path.GetFileName(e.filename);
AsyncFileUpload1.SaveAs(savePath);
}
}
A better solution to find ASP.NET ClientIDs with jQuery
A small routine that returns us a jQuery object based on only the id:
function $$(id, context) {
var el = $("#" + id, context);
if (el.length < 1)
el = $("[id$=_" + id + "]", context);
return el;
}
So in simple usage to select my ctl00_MainContent_txtSymbol value both of the following work:
alert( $$("txtSymbol").attr("id") );
Or if I want to be specific about the container:
alert( $$("txtSymbol",$("#wrapper")).attr("id") );
Via A generic way to find ASP.NET ClientIDs with jQuery – Rick Strahl’s Web Log
Facebook Developer Toolkit 3.0 – ASP.NET MVC Sample
Facebook Developer Toolkit 3.0 – ASP.NET MVC Sample
It’s almost time for the long awaited release of the Facebook Developer Toolkit 3.0, the most awesomest release of the toolkit to date. The new version has great support for ASP.NET, ASP.NET MVC, Silverlight, WinForms, WPF and basically any place you can run .NET.
Labs of ASP.NET MVC Training Kit
Labs
Introduction to ASP.NET MVC
This hands-on-lab will introduce you to developing web applications with ASP.NET MVC and teach you the basic conventions and features contained within it. It will also show you how to unit test your custom controllers as well as your application’s route definitions.Setup Lab Manual (html | docx) Source Files
Enhancing Asp.NET MVC Applications
This hands-on-lab will show you how to deal with some additional common requirements that occur when developing application with ASP.NET MVC. This includes: handling form posting/validation, model binders, partial views, and action filters.
MVC, MVP, MVVM Design Patterns
1. The 1st half of this article will compare and contrast MVC, MVP, and MVVM, and suggest which pattern to use based on your technology of choice and the problem that you are trying to solve. The 2nd half will be an overview about how MVVM could be used in Silverlight.
Read more here -> CodeProject: Model View Controller, Model View Presenter, and Model View ViewModel Design Patterns. Free source code and programming help
2. Model-View-ViewModel (better known by its super hero alias of MVVM ) is a great pattern to use with Silverlight and WPF. Here is a 5 minute perspective on MVVM.
Why?
1 reason MVVM works really well with XAML based applications is because of the powerful XAML binding features. This allows the View (the presentation of to the user) to be separated from the data and the logic. The View can be designed in Expression Blend while the ViewModel can be developed in Visual Studio .NET. It allows for the presentation to be separated very easily. This is just 1 reason, albeit a powerful one.
Read more here –> http://johnpapa.net/silverlight/5-minute-overview-of-mvvm-in-silverlight/
Paging and Sorting ListView Control with jQuery Tablesorter plugins within ASP.NET MVC
This article provides a simple example of using jQuery along with the jQuery tablesorter and tablesorter.pager plug-ins to provide sorting and paging support for a listview within the context of an ASP.NET MVC application.





