Asp.net 通过刷新页面防止隐藏网格
我用c#在asp.net中制作了一个表单,其中网格视图和数据显示正确,但我也在表单上制作了“插入-删除”按钮,当我单击“插入”按钮时,页面被刷新,网格视图无法看到如何解决此问题并防止隐藏网格`Asp.net 通过刷新页面防止隐藏网格,asp.net,Asp.net,我用c#在asp.net中制作了一个表单,其中网格视图和数据显示正确,但我也在表单上制作了“插入-删除”按钮,当我单击“插入”按钮时,页面被刷新,网格视图无法看到如何解决此问题并防止隐藏网格` <table style ="margin-left:50px;"> <tr> <td style ="width:10px;"> <asp:Button UseSubmitBehavio
<table style ="margin-left:50px;">
<tr>
<td style ="width:10px;">
<asp:Button UseSubmitBehavior="true" ID="bttnadd" runat="server" Text="Add" style ="width:60px; background-color:azure" OnClick="bttnadd_Click" CommandName="bttnadd" OnClientClick ="showgrid()"/> </td>
<td colspan ="2;">
<asp:Button ID="bttndelete" runat="server" Text="Delete" style ="width:60px;background-color:azure" /> </td >
<td colspan ="0;">
<asp:Button ID="Bttnupdate" runat="server" Text="update" style ="width:60px; background-color:azure" /> </td>
<td class="auto-style6">
<asp:Button ID="Bttnreset" runat="server" Text="Reset" style ="width:60px; background-color:azure" />
</td>
</tr>
</table>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="category_id" DataSourceID="SqlDataSource1"
HorizontalAlign="Right" PageSize="5"
EnablePersistedSelection="True" ViewStateMode="Enabled"
Width="1px" CellPadding="4" Font-Size="Medium"
ForeColor="#333333" GridLines="None"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged1">
<AlternatingRowStyle HorizontalAlign="Right" VerticalAlign="Top"
BackColor="White" />
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
<asp:BoundField DataField="category_id" HeaderText="category_id" InsertVisible="False" ReadOnly="True" SortExpression="category_id" />
<asp:BoundField DataField="category_name" HeaderText="category_name" SortExpression="category_name" />
<asp:BoundField DataField="category_description" HeaderText="category_description" SortExpression="category_description" />
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerSettings Mode="NextPreviousFirstLast" />
<PagerStyle HorizontalAlign="Center" BackColor="#FFCC66" ForeColor="#333333" />
<RowStyle HorizontalAlign="Right" BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#9966FF" Font-Bold="True" ForeColor="Navy" />
<SortedAscendingCellStyle BackColor="#FDF5AC" />
<SortedAscendingHeaderStyle BackColor="#4D0000" />
<SortedDescendingCellStyle BackColor="#FCF6C0" />
<SortedDescendingHeaderStyle BackColor="#820000" />
</asp:GridView>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="category_id" DataSourceID="SqlDataSource1"
HorizontalAlign="Right" PageSize="5"
EnablePersistedSelection="True" ViewStateMode="Enabled"
Width="1px" CellPadding="4" Font-Size="Medium"
ForeColor="#333333" GridLines="None"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged1">
<AlternatingRowStyle HorizontalAlign="Right" VerticalAlign="Top"
BackColor="White" />
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
<asp:BoundField DataField="category_id" HeaderText="category_id" InsertVisible="False" ReadOnly="True" SortExpression="category_id" />
<asp:BoundField DataField="category_name" HeaderText="category_name" SortExpression="category_name" />
<asp:BoundField DataField="category_description" HeaderText="category_description" SortExpression="category_description" />
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerSettings Mode="NextPreviousFirstLast" />
<PagerStyle HorizontalAlign="Center" BackColor="#FFCC66" ForeColor="#333333" />
<RowStyle HorizontalAlign="Right" BackColor="#FFFBD6"
ForeColor="#333333" />
<SelectedRowStyle BackColor="#9966FF" Font-Bold="True"
ForeColor="Navy" />
<SortedAscendingCellStyle BackColor="#FDF5AC" />
<SortedAscendingHeaderStyle BackColor="#4D0000" />
<SortedDescendingCellStyle BackColor="#FCF6C0" />
<SortedDescendingHeaderStyle BackColor="#820000" />
</asp:GridView>
`请从CS页面共享页面加载事件。我已将asp.net中formaspx页面的页面加载事件与c sharp共享。如何从css共享它?