摘要:1.首先将JS文件ASP.NET custom control空间的DLL工程里面,将类型选择为Embedded resource2. 假设欲添加的JS文件是AjaxEnabled.js,而这个DLL工程的Assembly名字是PassTextBox,那么我们应该打开这个DLL工程的AssemblyInfo文件,添加如下attribute:[assembly: System.Web.UI.WebResource("PassTextBox.AjaxEnabled.js","text/JavaScript")]3. 当在DLL工程里面需要引用到这个JS文件的
阅读全文
摘要:首先假设有如下的继承于Sys.UI.Control的JS代码,我们期望将其封装在一个Custom Control里面,即以DLL的形式在多个application里面使用:///<reference name="MicrosoftAjax.js"/>Type.registerNamespace("AjaxEnabled");AjaxEnabled.PassTextBox = function (element) { AjaxEnabled.PassTextBox.initializeBase(this, [element]); this._w
阅读全文
摘要:有如下代码: 1 /// <reference name="MicrosoftAjax.js"/> 2 3 Type.registerNamespace("AjaxEnabled"); 4 5 //create constructor 6 AjaxEnabled.PassTextBox = function(element) { 7 AjaxEnabled.PassTextBox.initializeBase(this, [element]); 8 9 this._weakCssClass = null;10 this._mediumCssC
阅读全文
摘要:有代码如下: 1 /// <reference name="MicrosoftAjax.js"/> 2 Type.registerNamespace("AjaxEnabled"); 3 4 AjaxEnabled.PasswordStrengthComponent = function () { 5 AjaxEnabled.PasswordStrengthComponent.initializeBase(this); 6 }; 7 8 AjaxEnabled.PasswordStrengthComponent.prototype = { 9
阅读全文