-1

Hello i need to stay on a jquery tab after asp.net postback, but nothing what i found here or somewhere else in the web works for me.

I tried:

Staying on current jQuery tab across post back?

and

Jquery postback, maintain same tab after postback

but also some other sources.

Everytime when im changing

  $("#tabs").tabs(); 

to something like:

 $(function () {
   $("#tabs").tabs({
       show: function() {
          var selectedTab = $('#tabs').tabs('option', 'selected');
          $("#<%= hdnSelectedTab.ClientID %>").val(selectedTab);
          },
       selected: <%= hdnSelectedTab.Value %>
   });
 });

With hiddenfield etc. i get this error 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'tabs'.

When im Using the jquery.cookie.js file with this code:

 $("#tabs").tabs({ cookie: { expires: 1 } });

i dont get an error but i dont stay on the tab after postback.

Community
  • 1
  • 1
user2157063
  • 49
  • 2
  • 10

2 Answers2

0

You can give your input button a css class.

#inputField { 
display:none !important; 
}

Save this as yourCssClass.css

document.getElementById("inputField ").className += "yourCssClass";

Add this to your JavaScript

Freddy
  • 960
  • 1
  • 20
  • 46
-1

I found out what the Problem was, I inserted jquery on the end of my master page because of that somehow it overwrote the jqueryui file in that specific aspx file. After i added the jqueryui.js file after the jquery.js everything worked fine.

user2157063
  • 49
  • 2
  • 10