Archive for the ‘ jDiv ’ Category

JQuery in ASP.NET Applications – My jDiv Solution

So, I have a general frustration with working with jQuery in an ASP.NET application. The first, and most obvious, is the ugly markup the HTML controls output. The muddled IDs and the inability to add custom HTML attributes is frustrating.

So, I’ve begun work on a set of classes & controls to help developers work with jQuery in a .NET application.

So far, I’ve composed a jDiv class to use from code behind to generate clean Div tags with as many classes & custom attributes as you like. Also, you can add as many children jDiv elements as you’d like and then just call the parent’s .ToString() method to output all of the markup. This may sound simple, but it is a great tool when you want to use server side C# or VB to output some data, then you want to use jQuery to animate it. The .ToString() method will output the markup, which you can easily output to a clean div.

Continue reading