asp.net 自定义控件的commandName属性,点击按钮 不能进入到GridView的RowCommand函数?
asp代码如下(按钮控件是这句话<asp:ButtonID="Button1"runat="server"Text="Go"CommandName="Golll"/>点击...
asp代码如下(按钮控件是这句话<asp:Button ID="Button1" runat="server" Text="Go" CommandName="Golll" />点击Button不能跳转到GridView的RowCommand函数): <asp:GridView ID="GVArticleManage" runat="server" ondatabound="GVArticleManage_DataBound"
onpageindexchanged="GVArticleManage_PageIndexChanged"
onpageindexchanging="GVArticleManage_PageIndexChanging" onrowcommand="GVArticleManage_RowCommand"
>
<PagerTemplate>
<br />
<asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1) + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
<asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First" ></asp:LinkButton>
<asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev" ></asp:LinkButton>
<asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next" ></asp:LinkButton>
<asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last" ></asp:LinkButton>
到第<asp:TextBox runat="server" ID="inPageNum" width = "50"></asp:TextBox>页
<asp:Button ID="Button1" runat="server" Text="Go" CommandName="Golll" />
<br />
</PagerTemplate>
</asp:GridView> 展开
onpageindexchanged="GVArticleManage_PageIndexChanged"
onpageindexchanging="GVArticleManage_PageIndexChanging" onrowcommand="GVArticleManage_RowCommand"
>
<PagerTemplate>
<br />
<asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1) + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
<asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First" ></asp:LinkButton>
<asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev" ></asp:LinkButton>
<asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next" ></asp:LinkButton>
<asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last" ></asp:LinkButton>
到第<asp:TextBox runat="server" ID="inPageNum" width = "50"></asp:TextBox>页
<asp:Button ID="Button1" runat="server" Text="Go" CommandName="Golll" />
<br />
</PagerTemplate>
</asp:GridView> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询