CS0117: “System.Web.UI.WebControls.TextBox”并不包含“text”的定义
我用的是VS2005刚开始学习ASP.NET用的C#;经常出现CS0117错误:并不包含“text”的定义等等请问是怎么回事?贴一个源文件:<%@PageLanguage...
我用的是VS2005 刚开始学习ASP.NET 用的C#;
经常出现CS0117错误:并不包含“text”的定义 等等
请问是怎么回事?
贴一个源文件:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script runat="server">
void Check_Clicked(Object sender, EventArgs e)
{
if (SameCheckBox.Checked) shiptextbox.text = billtextbox.text;
else shiptextbox.text = "";
}</script>
</head>
<body>
<form id="form1" runat="server">
<h3>checkbox示例</h3>
<p>
</p>
<table style="border:0">
<tr><td style="width: 184px">账单地址:</td><td>送达地址:</td></tr>
<tr><td style="width: 184px"><asp:TextBox ID="billtextbox" TextMode="MultiLine" Rows="5" runat="server" OnTextChanged="billtextbox_TextChanged"></asp:TextBox></td><td><asp:TextBox ID="shiptextbox" TextMode="MultiLine" Rows="5" runat="server"></asp:TextBox></td></tr>
<tr><td style="width: 184px"></td><td><asp:CheckBox ID="SameCheckBox" AutoPostBack="true" Text="和账单地址一样" TextAlign="Right" OnCheckedChanged="Check_Clicked" runat="server" /></td></tr>
</table>
</form>
</body>
</html> 展开
经常出现CS0117错误:并不包含“text”的定义 等等
请问是怎么回事?
贴一个源文件:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script runat="server">
void Check_Clicked(Object sender, EventArgs e)
{
if (SameCheckBox.Checked) shiptextbox.text = billtextbox.text;
else shiptextbox.text = "";
}</script>
</head>
<body>
<form id="form1" runat="server">
<h3>checkbox示例</h3>
<p>
</p>
<table style="border:0">
<tr><td style="width: 184px">账单地址:</td><td>送达地址:</td></tr>
<tr><td style="width: 184px"><asp:TextBox ID="billtextbox" TextMode="MultiLine" Rows="5" runat="server" OnTextChanged="billtextbox_TextChanged"></asp:TextBox></td><td><asp:TextBox ID="shiptextbox" TextMode="MultiLine" Rows="5" runat="server"></asp:TextBox></td></tr>
<tr><td style="width: 184px"></td><td><asp:CheckBox ID="SameCheckBox" AutoPostBack="true" Text="和账单地址一样" TextAlign="Right" OnCheckedChanged="Check_Clicked" runat="server" /></td></tr>
</table>
</form>
</body>
</html> 展开
2个回答
展开全部
<script runat="server">
void Check_Clicked(Object sender, EventArgs e)
{
if (SameCheckBox.Checked) shiptextbox.text = billtextbox.text;
else shiptextbox.Text = "";
}</script>
void Check_Clicked(Object sender, EventArgs e)
{
if (SameCheckBox.Checked) shiptextbox.text = billtextbox.text;
else shiptextbox.Text = "";
}</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询