首页 新闻 会员 周边

在母板页中TextBox如何取值?

0
悬赏园豆:5 [已解决问题] 解决于 2008-06-06 08:49
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">TextBox</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">onblurb</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">并传</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">ClientID<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></FONT></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序代码为:</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><FONT face="Times New Roman">&lt;asp:TextBox ID="TextBox1" runat="server" onblur="chkVal(this,'&lt;%= Me.TextBox2.ClientID %&gt;');" /&gt; <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">但执行后解析出来的</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">html</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">却变成:</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><FONT size=3><FONT face="Times New Roman">&lt;input name="ctl00$CPH1_Main$TextBox1" type="text" id="ctl00_CPH1_Main_TextBox1" onblur="chkVal(this,'&amp;lt;%= Me.TextBox2.ClientID %&gt;');" /&gt;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">请教我要如何正确传</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">TextBox2.ClientID</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的值</SPAN><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">谢谢</SPAN><FONT face="Times New Roman"> <SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">cs</FONT></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-
★金★的主页 ★金★ | 初学一级 | 园豆:190
提问于:2008-06-04 15:17
< >
分享
最佳答案
0
干吗不用Html控件?
沙加 | 老鸟四级 |园豆:3680 | 2008-06-05 09:43
其他回答(4)
0
在PageLoad中用下面代码 [code] TextBox1.Attributes.Add("onblur","chkVal(this,'"+TextBox2.ClientID+"'); "); [/code]
玉开 | 园豆:8822 (大侠五级) | 2008-06-04 15:20
0
http://www.cnblogs.com/lyj/archive/2007/10/30/943527.html 或许对你有些作用~~
李永京 | 园豆:3114 (老鸟四级) | 2008-06-04 15:29
0
先运行,运行完以后查看源代码他的id,然后再把他写到程序里、
田志鹏 | 园豆:185 (初学一级) | 2008-06-04 18:02
0
可以在子页面直接获取母板中控件的取值的。 您这里可以类似这么取值: string tmpValue = (Master.FindControl("TextBox2") as TextBox).Text;
致博腾远 | 园豆:1389 (小虾三级) | 2008-06-05 09:07
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册