如何访问方法javascript asp自定义控件使用$ get [英] how to access method javascript asp custom control use $get

查看:62
本文介绍了如何访问方法javascript asp自定义控件使用$ get的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我创建了一个txtText



< pre lang =   c# >  
public class ma:TextBox,IScriptControl





我已经包含了js



  protected  虚拟 IEnumerable< ScriptReference> GetScriptReferences()
{
return new ScriptReference [] {
new ScriptReference( Sample.Resources.Ma.js 示例
};
}

protected virtual IEnumerable< ScriptDescriptor> GetScriptDescriptors()
{
ScriptControlDescriptor descriptor = new ScriptControlDescriptor( Sample.ma this .ClientID);
descriptor.AddProperty( upperCase ._大写);
return new ScriptDescriptor [] {descriptor};

}

IEnumerable< ScriptReference> IScriptControl.GetScriptReferences()
{
return GetScriptReferences();
}

IEnumerable< ScriptDescriptor> IScriptControl.GetScriptDescriptors()
{
return GetScriptDescriptors();
}




我写的javacrirpt文件中的




< pre lang =Javascript> get_upperCase: function (){
return ._大写;
},

set_upperCase: function (value){
if this ._ upperCase!== value){
this ._ upperCase =值;
this .raisePropertyChanged(' upperCase'< /跨度>);
}
},





在形式上,我想使用方法get_upperCase。如果我使用函数$ find,我发现这些方法但是如果使用$(#<%= MA.ClientID%>)或$ get(<%= MA.ClientID%>),我就不能访问这些方法。



谢谢你的支持

解决方案

find,我发现这些方法但是如果使用


(#<%= MA.ClientID%>)或


get(<%= MA.ClientID%> ),我不会访问这些方法。



感谢您的支持


Hi everyone.
I create a txtText

<pre lang="c#">
public class ma : TextBox, IScriptControl



I have include js

protected virtual IEnumerable<ScriptReference> GetScriptReferences()
        {
            return new ScriptReference[] {
                new ScriptReference("Sample.Resources.Ma.js", "Sample")
            };
        }

        protected virtual IEnumerable<ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("Sample.ma", this.ClientID);
            descriptor.AddProperty("upperCase", this._upperCase);
            return new ScriptDescriptor[] { descriptor };

        }

        IEnumerable<ScriptReference> IScriptControl.GetScriptReferences()
        {
            return GetScriptReferences();
        }

        IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors()
        {
            return GetScriptDescriptors();
        }



in javacrirpt file i wrote

get_upperCase: function () {
       return this._upperCase;
   },

   set_upperCase: function (value) {
       if (this._upperCase !== value) {
           this._upperCase = value;
           this.raisePropertyChanged('upperCase');
       }
   },



when in form, i want to use method get_upperCase. if I use function $find, I found these methods but if use $("#<%=MA.ClientID%>") or $get(<%=MA.ClientID%>"), i dont access these methods.

thank you for support

解决方案

find, I found these methods but if use


("#<%=MA.ClientID%>") or


get(<%=MA.ClientID%>"), i dont access these methods.

thank you for support


这篇关于如何访问方法javascript asp自定义控件使用$ get的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆