“object”不包含“Checked”的定义,并且找不到可接受类型为“object”的第一个参数的扩展方法“Checked”(是不是缺少 using 指令或者程
“object”不包含“Checked”的定义,并且找不到可接受类型为“object”的第一个参数的扩展方法“Checked”(是否缺少 using 指令或者程
.cs文件
protected void cbTitle_CheckedChanged(object cbTitle, EventArgs e)
{
if (cbTitle.Checked == false)
txtTitle.Text = "";
}
protected void cbAuthor_CheckedChanged(object cbAuthor, EventArgs e)
{
if (cbAuthor.Checked == false)
txtAuthor.Text = "";
}
protected void cbPress_CheckedChanged(object cbPress, EventArgs e)
{
if (cbPress.Checked == false)
txtPress.Text = "";
.aspx文件
<tr>
<td class="style3">
<asp:CheckBox ID="cbTitle" runat="server" AutoPostBack="True" Text="按书名查找记录" OnCheckedChanged="cbTitle_CheckedChanged" />
</td>
<td align="right" class="style5">
<asp:Label ID="lblTitle" runat="server" Text="书名"></asp:Label>
</td>
<td class="style2">
<asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
</td>
</tr>
<br />
<tr>
<td class="style4">
<asp:CheckBox ID="cbAuthor" runat="server" AutoPostBack="True"
OnCheckedChanged="cbAuthor_CheckedChanged" Text="按作者查找记录" />
</td>
<td align="right" class="style9">
<asp:Label ID="lblAuthor" runat="server" Text="作者"></asp:Label>
</td>
<td class="style6">
<asp:TextBox ID="txtAuthor" runat="server"></asp:TextBox>
</td>
</tr>
<br />
<tr>
<td class="style4">
<asp:CheckBox ID="cbPress" runat="server" AutoPostBack="True"
OnCheckedChanged="cbPress_CheckedChanged" Text="按出版社查找记录" />
</td>
<td align="right" class="style9">
<asp:Label ID="lblPress" runat="server" Text="出版社"></asp:Label>
</td>
<td class="style6">
<asp:TextBox ID="txtPress" runat="server"></asp:TextBox>
</td>
</tr>
求大神指导!
------解决思路----------------------
不是显式转换参数类型,是显式转换变量((CheckBox)cbTitle).Checked == false
.cs文件
protected void cbTitle_CheckedChanged(object cbTitle, EventArgs e)
{
if (cbTitle.Checked == false)
txtTitle.Text = "";
}
protected void cbAuthor_CheckedChanged(object cbAuthor, EventArgs e)
{
if (cbAuthor.Checked == false)
txtAuthor.Text = "";
}
protected void cbPress_CheckedChanged(object cbPress, EventArgs e)
{
if (cbPress.Checked == false)
txtPress.Text = "";
.aspx文件
<tr>
<td class="style3">
<asp:CheckBox ID="cbTitle" runat="server" AutoPostBack="True" Text="按书名查找记录" OnCheckedChanged="cbTitle_CheckedChanged" />
</td>
<td align="right" class="style5">
<asp:Label ID="lblTitle" runat="server" Text="书名"></asp:Label>
</td>
<td class="style2">
<asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
</td>
</tr>
<br />
<tr>
<td class="style4">
<asp:CheckBox ID="cbAuthor" runat="server" AutoPostBack="True"
OnCheckedChanged="cbAuthor_CheckedChanged" Text="按作者查找记录" />
</td>
<td align="right" class="style9">
<asp:Label ID="lblAuthor" runat="server" Text="作者"></asp:Label>
</td>
<td class="style6">
<asp:TextBox ID="txtAuthor" runat="server"></asp:TextBox>
</td>
</tr>
<br />
<tr>
<td class="style4">
<asp:CheckBox ID="cbPress" runat="server" AutoPostBack="True"
OnCheckedChanged="cbPress_CheckedChanged" Text="按出版社查找记录" />
</td>
<td align="right" class="style9">
<asp:Label ID="lblPress" runat="server" Text="出版社"></asp:Label>
</td>
<td class="style6">
<asp:TextBox ID="txtPress" runat="server"></asp:TextBox>
</td>
</tr>
求大神指导!
------解决思路----------------------
不是显式转换参数类型,是显式转换变量((CheckBox)cbTitle).Checked == false