Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to control tabs from post back in asp .net i tried lot but didnt get any solution yet!
If anybody help me its really good for me!
Posted
Comments
DamithSL 24-Feb-15 0:11am    
what you mean by control tabs? can you update the question with the code which you tried and also explain your issue in detail.
Member 11222123 24-Feb-15 1:28am    
I mean to say just want when i click on button my tabs will not go to first position
Sujith Karivelil 24-Feb-15 0:19am    
what you have tried so far? could you please include that snippet?
Tejas Vaishnav 24-Feb-15 1:15am    
control tab means? it's not possible to answer your question without proper description of you requirement. and also if you have tried something and you are stuck at any point just add that description too in your question.

for editing your question to add more detail please use improve question functionality.

1 solution

//Its code m using in .cs file

XML
String hiddenFieldValue = Request.Form["theHiddenTabIndex"] ?? "0";
StringBuilder js = new StringBuilder();
js.Append("<script type='text/javascript'>");
js.Append("var previouslySelectedTab = ");
js.Append(hiddenFieldValue);
js.Append(";</script>");
this.Header.Controls.Add(new LiteralControl(js.ToString()));


//and they are the code which i used in aspx page

<script type="text/javascript">
$(document).ready(function() {
var index = 0;
var tabIndex = $('#<%= hidLastTab.ClientID %>').val();
if (tabIndex != " ") {
index = tabIndex;
}
$("#tabs").tabs({
select: function(event, ui) {
$('#<%= hidLastTab.ClientID %>').val(ui.index);
},
selected: parseInt(parseInt(tabIndex))
});

});

        function pageLoad(sender, args) {

            if (args.get_isPartialLoad()) {
               setAccordion();
               setTabs();

            }

        }
</script>
 
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