关于GridView的问题,无法触发GridView1_RowCommand里的事件
首先声明,我不是学C#,所以语法几乎不懂,被蛋疼的老师(不是教C#语言的)逼着用C#做简单网站!<asp:GridViewID="GridView1"runat="ser...
首先声明,我不是学C#,所以语法几乎不懂,被蛋疼的老师(不是教C#语言的)逼着用C#做简单网站!
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" HorizontalAlign="Center" Visible="False" >
<Columns>
<asp:BoundField DataField="bookName" HeaderText="图书名称"
SortExpression="bookName" />
<asp:BoundField DataField="typeName" HeaderText="图书类型"
SortExpression="typeName" />
<asp:BoundField DataField="bookConcern" HeaderText="出版社"
SortExpression="bookConcern" />
<asp:BoundField DataField="author" HeaderText="作者" SortExpression="author" />
<asp:BoundField DataField="borrowDay" HeaderText="可借天数"
SortExpression="borrowDay" />
<asp:BoundField DataField="price" HeaderText="定价" SortExpression="price" />
<asp:TemplateField HeaderText="借阅" ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
CommandName="borrow" Text="借阅"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView> 展开
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" HorizontalAlign="Center" Visible="False" >
<Columns>
<asp:BoundField DataField="bookName" HeaderText="图书名称"
SortExpression="bookName" />
<asp:BoundField DataField="typeName" HeaderText="图书类型"
SortExpression="typeName" />
<asp:BoundField DataField="bookConcern" HeaderText="出版社"
SortExpression="bookConcern" />
<asp:BoundField DataField="author" HeaderText="作者" SortExpression="author" />
<asp:BoundField DataField="borrowDay" HeaderText="可借天数"
SortExpression="borrowDay" />
<asp:BoundField DataField="price" HeaderText="定价" SortExpression="price" />
<asp:TemplateField HeaderText="借阅" ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
CommandName="borrow" Text="借阅"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询