首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

救命啊!

2011-12-12 
救命啊!!高手们帮下忙:我在用户控件中有段html为:asp:textboxid txt_Start runat server Width 1

救命啊!!
高手们帮下忙:
我在用户控件中有段html为:
<asp:textbox   id= "txt_Start "   runat= "server "   Width= "100px "   ReadOnly= "True "     onpropertychange= "getEndDate(this, <%#this.txt_EndDate.ClientID%> ); "   AutoPostBack= "True "> </asp:textbox>

其中我想通过   <%#this.txt_EndDate.ClientID%>   找到   txt_EndDate   以便在getEndDate这个js函数中对该控件操作   。

可是我在运行后的html源代码中发现   onpropertychange= "getEndDate(this, <%#this.txt_EndDate.ClientID%> ); "   也就是说     <%#this.txt_EndDate.ClientID%>   被原样传到了客户端   ,没有执行?
怎么解决呢?

[解决办法]
沙发,帮忙顶
[解决办法]
up
[解决办法]
try:

<asp:textbox id= "txt_Start " runat= "server " Width= "100px " ReadOnly= "True " onpropertychange= "getEndDate(this); " AutoPostBack= "True "> </asp:textbox>

function getEndDate(obj){
var id = " <%#this.txt_EndDate.ClientID%> ";
}

不要把 <%#this.txt_EndDate.ClientID%> 放在服务器控件中使用
[解决办法]
在后台写this.txt_Start.Attributes.Add( "onpropertychange ", "get.....
[解决办法]
up
[解决办法]
BearRui(AK-47) ( 两星(中级))

可行

热点排行