我把它放在一个表格中
是这样的
<table>
<tr>
<td>
<asp:textbox id="Textbox7" runat="server" Width="110px"></asp:textbox><br>
</td>
</tr>
</table>
我这样放以后就不能这样引用了:string s=TextBox7.text;
出错是没设置到引用对象
是这样的
<table>
<tr>
<td>
<asp:textbox id="Textbox7" runat="server" Width="110px"></asp:textbox><br>
</td>
</tr>
</table>
我这样放以后就不能这样引用了:string s=TextBox7.text;
出错是没设置到引用对象
string s=TextBox7.text;中的"B"与上面id="Textbox7"不对应
改为:
string s=Textbox7.text;
<asp:textbox id="Textbox7" runat="server" AutoPostBack=true Width="110px"></asp:textbox><br>
现在我知道为什么了把TEXTBOX改为PUBLIC就可以了