我想请问以下asp.net(c#)中我在GridView中运用了一个按钮我要跳转到另外一页 点了没有反应
我的代码如下:<asp:GridViewID="GridView1"runat="server"BackColor="White"BorderColor="#336666...
我的代码如下:
<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" GridLines="Horizontal" AutoGenerateColumns="False"
Width="618px" OnSelectedIndexChanging="GridView1_SelectedIndexChanging" OnPageIndexChanged="GridView1_PageIndexChanged" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCancelingEdit="GridView1_RowCancelingEdit">
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:BoundField DataField="Title" HeaderText="标题" SortExpression="Title" NullDisplayText="No Record"/>
<asp:BoundField DataField="OnTime" HeaderText="发表时间" SortExpression="OnTime" NullDisplayText="No Record"/>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<a href='Laws.aspx?id=<%# DataBinder.Eval(Container.DataItem,"id")%>'><asp:Button ID="Button1" runat="server" CausesValidation="false" CommandName=""
Text="修改" /></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
我刚刚发了就过后我就改用字了 开始的时候只是觉得按钮比字好看点 那下一个页面怎么接收ID值呢 数据库中要判断ID 问题多了点 不好意思啊 学习当中 展开
<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" GridLines="Horizontal" AutoGenerateColumns="False"
Width="618px" OnSelectedIndexChanging="GridView1_SelectedIndexChanging" OnPageIndexChanged="GridView1_PageIndexChanged" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCancelingEdit="GridView1_RowCancelingEdit">
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:BoundField DataField="Title" HeaderText="标题" SortExpression="Title" NullDisplayText="No Record"/>
<asp:BoundField DataField="OnTime" HeaderText="发表时间" SortExpression="OnTime" NullDisplayText="No Record"/>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<a href='Laws.aspx?id=<%# DataBinder.Eval(Container.DataItem,"id")%>'><asp:Button ID="Button1" runat="server" CausesValidation="false" CommandName=""
Text="修改" /></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
我刚刚发了就过后我就改用字了 开始的时候只是觉得按钮比字好看点 那下一个页面怎么接收ID值呢 数据库中要判断ID 问题多了点 不好意思啊 学习当中 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询