• 中文(香港特別行政區)
    • English (United States)
    • العربية (مصر)
    • Deutsch (Deutschland)
    • Español (España, alfabetización internacional)
    • français (France)
    • हिंदी (भारत)
    • italiano (Italia)
    • 日本語 (日本)
    • 한국어 (대한민국)
    • Nederlands (Nederland)
    • polski (Polska)
    • русский (Россия)
    • ไทย (ไทย)
    • Türkçe (Türkiye)
    • Tiếng Việt (Việt Nam)
    • 中文(中华人民共和国)
  • 登錄
  • 註冊

DNA jQuery Web Controls for ASP.NET

隱藏邊欄

Challenges of using jQuery in ASP.NET




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 we have to write more and more...

Large number of script references



In addition to jQuery core file there are more than 30 .js files of jQuery ui plugins,jQuery effects,jQuery language resources.In the ASP.NET application to manage such a large number of script references is a disturbing work.The download traffic will increase from adding script references,to reference all the scripts in page is a low-performance approach.so the script references in each page are supposed to register when necessary.
In ASP.NET should use ScriptManager to manage the scripts,but the scripts can only be registered in ApplicationInit event and ApplicationLoad event, some jquery plugins need to run in document ready event where they should be registered?

Too many "Option" to remember



As we all know $(selector).pluginName({options}) is the syntax of jQuery.It 's very easy to know ,to learn and to write.But only the plugin has a few options.Some jQuery plugin have to many options to remeber them so we have to review the documents of plugin option every time we using it.A few peoples can remember all options of jQuery ui plugin widgets,even just one widget I guess.It waste time to check the document and code syntax.

Duplicate HTML elements



When using some jQuer plugin that has ui in deifferen page we must copy and paste the html code or rewrite by hand! tabs and accordion is offen to use. they are html code is so more to write!This will cost more and more "Glue code".

Could not persist Server states



ASP.NET Web page using ViewState/ControlState to persist changes to the state of a Web Form across postbacks.How to enable this feature in using jQuery ? Across WebService or PageMethods ? So we must write the WebControl for the jQuery plugin.

jQuery selector and ClientID



When you want to apply the jQuery plugin to the one or more Server Controls what would you do? You must provide the element id or class name to jQuery selector but as we knows the Server Control's ID is not the real id until it render as html elements.And what would you do when put the Server Controls id to jQuery plugin 's option value?

Conflict with UpdatePanel



When you are using the jQuery in UpdatePanel is something wrong? even you write a WebControl for the jQuery plugin and put it into UpdatePanel after UpdatePanel async postback the jQuery plugin works fine? Learn more about it try google "UpdatePanel RegisterStartupScript".

Should ExtenderControl/ScriptControl do ?



In .Net3.5 the we can use ExtenderControl/ScriptControl to programmatically add AJAX functionality to an ASP.NET server control.It is a very good idea for using traditional javascript but not for jQuery.The first ExtenderControl/ScriptControl can only apply the AJAX capabilities to one Control,jQuery can apply multi elements.
The secord ExtenderControl/ScriptControl must have it's own javascript class ,what have happed when using ExtenderControl/ScriptControl to write a web control for jQuery plugin ? We must write anther wrapper class in javascript for the control,every control!That is not a good idea for you unless you like to write more and more code.

Runtime only UI



When using the jQuery ui plugin in ASP.NET,we could see what we get in DesignTime in VisualStudio,because the html elements show it real look in runtime only in using jQuery.So VisualStudio is not a Visual Design Tool it being a notepad.

(((DJ is the best choice for using jQuery in ASP.NET!)))

 


    Average:3
  • 閱讀
    (3712)
  • 固定連結
分享至:
Valid XHTML 1.0!