在使用C#进行gridview_RowDeleting和gridview_RowUpdating之后,如何保留在引导程序选项卡上 [英] How do I remain on bootstrap tab after gridview_RowDeleting and gridview_RowUpdating with c#

查看:171
本文介绍了在使用C#进行gridview_RowDeleting和gridview_RowUpdating之后,如何保留在引导程序选项卡上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在bootstrap选项卡上的一个选项卡中有一个asp gridview.我想在gridview_RowDeleting和gridview_RowUpdating事件之后保留在中间选项卡-检查选项卡"上,但它始终将我发送到第一个选项卡-个人选项卡.


< form id ="form1" runat ="server">

I have an asp gridview inside a tab on bootstrap tab. I want to remain on the middle tab - "Examinaton tab" after gridview_RowDeleting and gridview_RowUpdating events but it always send me to the first tab -Personal Tab.


<form id="form1" runat="server">


<!-tab导航开始->

< header class ="panel-heading tab-bg-primary">

<!--tab nav start-->

<header class="panel-heading tab-bg-primary ">















< asp:GridView ID ="gvDetails" DataKeyNames ="id,home" runat ="server"
AutoGenerateColumns ="false" CssClass ="Gridview" HeaderStyle-BackColor =#61A6F8"
ShowFooter ="true" HeaderStyle-Font-Bold ="true" HeaderStyle-ForeColor ="White"
OnRowCancelingEdit ="gvDetails_RowCancelingEdit"
OnRowDeleting ="gvDetails_RowDeleting" OnRowEditing ="gvDetails_RowEditing"
OnRowUpdating ="gvDetails_RowUpdating"
OnRowCommand ="gvDetails_RowCommand">
<列> < asp:TemplateField>
< edititemtemplate>
< asp:ImageButton ID ="imgbtnUpdate" CommandName ="Update" runat ="server" CausesValidation ="False" ImageUrl =〜/img/update.jpg" ToolTip ="Update" Height ="20px" Width ="20px "ValidationGroup =" validaiton"/>
< asp:ImageButton ID ="imgbtnCancel" runat ="server" CommandName ="Cancel" CausesValidation ="False" ImageUrl =〜/img/Cancel.jpg" ToolTip ="Cancel" Height ="20px" Width ="20px "ValidationGroup =" validaiton"/>

< itemtemplate>
< asp:ImageButton ID ="imgbtnEdit" CommandName ="Edit" runat ="server" ImageUrl =〜/img/Edit.jpg" CausesValidation ="False" ToolTip ="Edit" Height ="20px" Width ="20px "ValidationGroup =" validaiton"/>
< asp:ImageButton ID ="imgbtnDelete" CommandName =删除" Text ="Edit" runat =服务器" ImageUrl =〜/img/delete.jpg" CausesValidation ="False" ToolTip =删除" Height ="20px "Width =" 20px"ValidationGroup =" validaiton"/>

< footertemplate>
< asp:ImageButton ID ="imgbtnAdd" runat ="server" ImageUrl =〜/img/AddNewitem.jpg" CommandName ="AddNew" Width ="30px" Height ="30px" ToolTip =添加新用户" ValidationGroup = "validaiton"/>




< asp:TemplateField HeaderText ="home">
< edititemtemplate>
< asp:TextBox Width ="80px" ID ="txthome" MaxLength ="50" runat ="server" Text =''<%#Eval("home")%>''/>
< asp:RequiredFieldValidator ID ="rfvtxthome" runat ="server" ControlToValidate ="txthome" Text ="*" ValidationGroup ="validaiton"/>

< itemtemplate>
< asp:标签ID ="lblhome" runat ="server" Text =''<%#Eval("home")%>''/>

< footertemplate>
< asp:TextBox Width ="80px" ID ="txtftrhome" MaxLength ="50" runat ="server"/>
< asp:RequiredFieldValidator ID ="rfvhome" runat ="server" ControlToValidate ="txtftrhome" Text ="*" ValidationGroup ="validaiton"/>




<asp:GridView ID="gvDetails" DataKeyNames="id,home" runat="server"
AutoGenerateColumns="false" CssClass="Gridview" HeaderStyle-BackColor="#61A6F8"
ShowFooter="true" HeaderStyle-Font-Bold="true" HeaderStyle-ForeColor="White"
OnRowCancelingEdit="gvDetails_RowCancelingEdit"
OnRowDeleting="gvDetails_RowDeleting" OnRowEditing="gvDetails_RowEditing"
OnRowUpdating="gvDetails_RowUpdating"
OnRowCommand="gvDetails_RowCommand">
<columns> <asp:TemplateField>
<edititemtemplate>
<asp:ImageButton ID="imgbtnUpdate" CommandName="Update" runat="server" CausesValidation="False" ImageUrl="~/img/update.jpg" ToolTip="Update" Height="20px" Width="20px" ValidationGroup="validaiton" />
<asp:ImageButton ID="imgbtnCancel" runat="server" CommandName="Cancel" CausesValidation="False" ImageUrl="~/img/Cancel.jpg" ToolTip="Cancel" Height="20px" Width="20px" ValidationGroup="validaiton" />

<itemtemplate>
<asp:ImageButton ID="imgbtnEdit" CommandName="Edit" runat="server" ImageUrl="~/img/Edit.jpg" CausesValidation="False" ToolTip="Edit" Height="20px" Width="20px" ValidationGroup="validaiton" />
<asp:ImageButton ID="imgbtnDelete" CommandName="Delete" Text="Edit" runat="server" ImageUrl="~/img/delete.jpg" CausesValidation="False" ToolTip="Delete" Height="20px" Width="20px" ValidationGroup="validaiton" />

<footertemplate>
<asp:ImageButton ID="imgbtnAdd" runat="server" ImageUrl="~/img/AddNewitem.jpg" CommandName="AddNew" Width="30px" Height="30px" ToolTip="Add new User" ValidationGroup="validaiton" />




<asp:TemplateField HeaderText="home">
<edititemtemplate>
<asp:TextBox Width="80px" ID="txthome" MaxLength="50" runat="server" Text=''<%#Eval("home") %>'' />
<asp:RequiredFieldValidator ID="rfvtxthome" runat="server" ControlToValidate="txthome" Text="*" ValidationGroup="validaiton" />

<itemtemplate>
<asp:Label ID="lblhome" runat="server" Text=''<%#Eval("home") %>'' />

<footertemplate>
<asp:TextBox Width="80px" ID="txtftrhome" MaxLength="50" runat="server" />
<asp:RequiredFieldValidator ID="rfvhome" runat="server" ControlToValidate="txtftrhome" Text="*" ValidationGroup="validaiton" />














</form>




以下是C#代码
受保护的void gvDetails_RowUpdating(对象发送者,GridViewUpdateEventArgs e)
{
}
受保护的void gvDetails_RowDeleting(对象发送者,GridViewDeleteEventArgs e)
{
}


</form>




Below is the c# code
protected void gvDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
}
protected void gvDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
}

推荐答案

适合您的示例

Bootstrap选项卡在PostBack上保持选中(活动)选项卡在ASP.Net中 [ ^ ]
The example for you

Bootstrap Tabs Maintain Selected (Active) Tab on PostBack in ASP.Net[^]


这篇关于在使用C#进行gridview_RowDeleting和gridview_RowUpdating之后,如何保留在引导程序选项卡上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆