One Suggestion

Jun 22, 2009 at 1:59 PM

I will give a suggestion

Why not allow the script to link the type:
<script language="javascript" type="text/javascript" src="/include/jquery-1.3.2.min.js"> </ script>
in this case the browse (IE, Firefox), create a CACHE for this .JS file.

Well, the way it is developed through dynamic script ( "ScriptResource.axd") the browser does not "cache" this file.

would be better and more flexible if the path of the script to jquery could be informadado by Ownership,
a control of type DNA.JQuery.ScriptManager, would be a property such as:

Example:
DNA.JQuery.ScriptManager.JQuerySrc = ".. \ Include \ jquery-1.3.2.min.js"
DNA.JQuery.ScriptManager.JQueryCustomSrc = ".. \ Include \ jquery-ui-1.7.1.custom.min.js (optional) (this is the UI all in one archive)
DNA.JQuery.ScriptManager.JQueryDatePickerSrc = ".. \ Include \ jquery-DatePicker.min.js (optional)

Thus the user's browser will create a cache of these files and source code generated would be cleaner,
In addition to flexibility to update the version of Jquery Framework.

Thanksss

Jun 26, 2009 at 10:46 AM

I had the same idea ... and a solution.
Propably somebody can add it to the sourceCode.

This is possible with a small change in the Sourccode and an entry in then web.config:

<appSettings>
   <add key="isDotNetAge_jQueryScriptIsLoaded" value="true"/>
</appSettings> 

  111         public static void RegisterJQuery(Control ctrl)

  112         {

  113             string isDotNetAge_jQueryScriptIsLoaded = "";

  114             try

  115             {

  116                 isDotNetAge_jQueryScriptIsLoaded =
                       System.Configuration.ConfigurationSettings.AppSettings["isDotNetAge_jQueryScriptIsLoaded"];

  117             }

  118             catch (Exception)

  119             {

  120             }

  121 

  122             if (isDotNetAge_jQueryScriptIsLoaded == "true")

  123             {

  124                 return;

  125             }

  126 

  127 

  128             if (HttpContext.Current.Items["AddJQueryRegistedHandler"] == null)

  129             {

  130                 ctrl.Page.PreRenderComplete += new EventHandler(RegisterScriptsOnPagePreRenderComplete);

  131                 HttpContext.Current.Items["AddJQueryRegistedHandler"] = true;

  132                 string jqueryWebUrl = ctrl.Page.ClientScript.GetWebResourceUrl(typeof(jQuery.Res), "jQuery.core.js");

  133                 AddRefToContext(jqueryWebUrl);

  134 

  135                 //Fix png v1.0.1              

  136                 if (HttpContext.Current.Request.Browser.Browser == "IE")

  137                 {

  138                     if (HttpContext.Current.Request.Browser.MajorVersion < 7)

  139                     {

  140                         AddRefToContext(ctrl.Page.ClientScript.GetWebResourceUrl(typeof(jQuery.Res), "jQuery.plugins.pngFix.js"));

  141                         RegisterDocumentReadyScript(ctrl, "$(document).pngFix();");

  142                     }

  143                 }

  144             }

  145         }

<!--EndFragment-->
Jun 26, 2009 at 10:47 AM
Edited Jun 26, 2009 at 10:53 AM

I forgot:

changes were made in the DNA/ClientScriptManager.cs

Jun 26, 2009 at 10:57 AM

This fixes also another problem.

If a dialog is in an Usercontrol DotNetAge adds in IE a script:

<script type='text/javascript'>$().ready(function() {$.ui.dialog.defaults.bgiframe = true;});</script><script type='text/javascript'>$().ready(function() {$.ui.dialog.defaults.bgiframe = true;});</script>

But if the Usercontrol is not visible the jQuery-webrecource is not included but the script is still there and raises a javascript-error.