Click here to Skip to main content
15,904,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 nav start-->

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

</header>








<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>




Below is the c# code
protected void gvDetails_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
}
protected void gvDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
}
Posted
Comments
John C Rayan 12-Jan-16 4:39am    
Write a JQuery function that selects the tab id you want to be in. After _rowdeleting or _rowupdated invoke the Jquery function.
Member 10820603 12-Jan-16 4:41am    
Can you please give me an example?
John C Rayan 12-Jan-16 4:52am    
See the example in the solution
Sinisa Hajnal 12-Jan-16 4:47am    
On tab change set the tab id in url...since you're doing server trip it returns you to base page...but you can change that via url parameters.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900