Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have one user detail page in which i create three tabs : Details, image change and delete image. To prevent 3 separate pages for each so i created tab like structure.
ASP.NET
<ul id="tabs"> 
<li><a href="#tab1">Veiw/Edit Profile</a></li> 
<li><a href="#tab2">Change image</a></li>
<li><a href="#tab3">Delete image</a></li>
</ul>
<div class="container" id="tab1">
</div>

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="container" id="tab2">
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="btn_upload1" runat="server" Text="Update" onclick="btn_upload1_Click" />
</div>
</ContentTemplate>
<triggers>
<asp:PostBackTrigger ControlID="btn_upload1"/>
</triggers>
</asp:UpdatePanel>

<div class="container" id="tab3">
</div>

Problem is : when i am changing image from tab 2 and click button it does'nt remains on same tab after change image, it comes to tab1 and even after apply update panel it refresh the page.
Posted
Updated 12-Dec-14 23:46pm
v2

1 solution

You can write following code....


MainTab.ActiveTab = MainTab.Tabs(1)
tab_two.Enabled = True


This is VB code.. in that MainTab is your TabContainer id and (1) is your index. that is tab 2... tab_two is your TabPanel id

I think this will work for u..because this code is working for me.

I am using ajax toolkit for that.
 
Share this answer
 
v2

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