为什么我的gridview不能发现它的rowcommand事件?【有代码】
<divid="fragment-1"style="width:360px;height:280px;vertical-align:top;text-align:left...
<div id="fragment-1" style="width: 360px; height: 280px; vertical-align: top; text-align: left; border-top-width: 0px; top: 0px; cursor: pointer; border-spacing: 0px; " >
<asp:GridView ID="GridView报考" runat="server" AllowPaging="True" AutoGenerateColumns="False"
PageSize="14" Height="280px" ShowFooter="True" CaptionAlign="Top"
onrowcommand="GridView报考_RowCommand" >
<PagerSettings FirstPageText="" LastPageText="" Mode="NextPrevious"
NextPageText="" Visible="False" />
<RowStyle Font-Size="Small" ForeColor="#FF3300" Height="10px"
HorizontalAlign="Left" VerticalAlign="Top" />
<Columns >
<asp:TemplateField >
<HeaderTemplate>
<table style="border: 1px dashed #FF5050;"><tr><td align="left" valign="middle"
style="height:8px; background-image:url('TabSource/BackGround.GIF'); color: #FFFFFF; font-weight: inherit; font-size: medium; width: 360px;" >
报考常识</td></tr>
</table>
</HeaderTemplate>
<FooterTemplate>
<table style="width: 340px; height: 10px;">
<tr>
<td>
</td>
<td>
</td>
<td align="right">
<asp:ImageButton ID="ImageButton1" runat="server" Height="16px"
ImageUrl="~/TabSource/more.gif" Width="47px" />
</td>
</tr>
</table>
</FooterTemplate>
<ItemTemplate>
<table align="left"
style="width: 350px; height: 22px; font-size: small; color: #FF3300;">
<tr>
></asp:LinkButton>
【提示错误】编译器错误消息: CS1061: “ASP.tabknowledge_ascx”不包含“GridView报考_RowCommand”的定义,并且找不到可接受类型为“ASP.tabknowledge_ascx”的第一个参数的扩展方法“GridView报考_RowCommand”(是否缺少 using 指令或程序集引用?)
我是直接双击闪电图标下的RowCommand生成的 protected void GridView报考_RowCommand(object sender, GridViewCommandEventArgs e)
为什么会提示这个错误呢?? 展开
<asp:GridView ID="GridView报考" runat="server" AllowPaging="True" AutoGenerateColumns="False"
PageSize="14" Height="280px" ShowFooter="True" CaptionAlign="Top"
onrowcommand="GridView报考_RowCommand" >
<PagerSettings FirstPageText="" LastPageText="" Mode="NextPrevious"
NextPageText="" Visible="False" />
<RowStyle Font-Size="Small" ForeColor="#FF3300" Height="10px"
HorizontalAlign="Left" VerticalAlign="Top" />
<Columns >
<asp:TemplateField >
<HeaderTemplate>
<table style="border: 1px dashed #FF5050;"><tr><td align="left" valign="middle"
style="height:8px; background-image:url('TabSource/BackGround.GIF'); color: #FFFFFF; font-weight: inherit; font-size: medium; width: 360px;" >
报考常识</td></tr>
</table>
</HeaderTemplate>
<FooterTemplate>
<table style="width: 340px; height: 10px;">
<tr>
<td>
</td>
<td>
</td>
<td align="right">
<asp:ImageButton ID="ImageButton1" runat="server" Height="16px"
ImageUrl="~/TabSource/more.gif" Width="47px" />
</td>
</tr>
</table>
</FooterTemplate>
<ItemTemplate>
<table align="left"
style="width: 350px; height: 22px; font-size: small; color: #FF3300;">
<tr>
></asp:LinkButton>
【提示错误】编译器错误消息: CS1061: “ASP.tabknowledge_ascx”不包含“GridView报考_RowCommand”的定义,并且找不到可接受类型为“ASP.tabknowledge_ascx”的第一个参数的扩展方法“GridView报考_RowCommand”(是否缺少 using 指令或程序集引用?)
我是直接双击闪电图标下的RowCommand生成的 protected void GridView报考_RowCommand(object sender, GridViewCommandEventArgs e)
为什么会提示这个错误呢?? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询