按钮单击时更改选项卡容器 [英] change tab container when button click

查看:76
本文介绍了按钮单击时更改选项卡容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户详细信息页面,其中我创建了三个选项卡:详细信息,图像更改和删除图像。为了防止每个页面有3个单独的页面,所以我创建了像结构一样的标签。

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.

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



问题是:当我从标签2更改图像并单击按钮时,它在更改图像后仍未保留在同一选项卡上,它来到tab1,甚至在应用更新面板后它刷新页面。


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.

推荐答案

您可以编写以下代码....





MainTab。 ActiveTab = MainTab.Tabs(1)

tab_two.Enabled = True





这是VB代码。 。在MainTab中是你的TabContainer id,(1)是你的索引。这是标签2 ... tab_two是你的TabPanel id



我认为这对你有用..因为这段代码对我有用。



我正在使用ajax工具包。
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.


这篇关于按钮单击时更改选项卡容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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