2009/6/8 The DJ v1.1.15 is released. click here to get the new download.
jQuery is a lightweight open source JavaScript library (only 15kb in size) that in a relatively short span of time has become one of the most popular libraries on the web. "write less do more" is a very good idea for our web developers. But when using it in ASP.NET something had happened...
We had a challenge of using jQuery in ASP.NET as well.
$(function() {
$("#datepicker").datepicker(
buttonText:'Close',
changeMonth:true,
changeYear:true,
gotoCurrent:true,
showOn:'click',
onselect:function(){
///.....
});
});
over 5 options that i can't remember any more....
<div id="accordion">
<h3>
<a href="#">Section 1</a></h3>
<div>
Section 1 content here
</div>
<h3>
<a href="#">Section 2</a></h3>
<div>
Section 2 content here
</div>
<h3>
<a href="#">Section 3</a></h3>
<div>
Section 3 content here
</div>
</div>
So how can I "write less do more" ?! I write a lot of code for using jQuery!
Against such a background, I build a lightweight framework for jQuery in ASP.NET named "DJ".
INamingContainer, IPostbackEventHandler, IPostbackDataHandler. So the server control's code looks just like this:
using System;
using System.Web.UI;
using DNA.UI; //step1:Import the DNA.UI library
//step2: add the JQuery Attribute to your control class header
[JQuery(Assembly="jQuery",Name="lightbox",ScriptResources=new string[]
{"plugin.lightbox.js"})]
public class LightBox:Control
{
//step3: add the JQueryOption Attribute to the property header
[JQueryOption(Name = "fixedNavigation")]
public bool FixedNavigation { get; set; }
protected override void OnPreRender(EventArgs e)
{
//step4: Register the jQuery Control
DNA.UI.ClientScriptManager.RegisterJQueryControl(this);
base.OnPreRender(e);
}
}
It's great! In just four steps, I wrote the lightbox Server Control! So I wrote all widgets of jquery.ui in "DJ" so that you can use theme to build your ASP.NET application quickly or you can using this framework to write your own jquery Server Controls!
See the difference between using pure jquery client script and DJ WebControl:
If you want to see more live demo of "DJ", you can visit my website and I put the latest version source code on CodePlex.
| You must Sign In to use this message board. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||