Jquery Tabs Won't Select From The Index

Apr 15, 2010

I am using ASP.NET page with updatepanels and Jquery UI tabs. However, I'm having a problem with it. When I click on a button it should set the value of a hidden field which when the page posts back, it will select the new tab. So in document onload set the tab to the initialised value of the hidden field:

$(function()
{
var loadTab = $("#<%= hidTabSelected.ClientID %>").val();

$('#dvJqTabs').tabs(
{ selected: loadTab ,
select: saveTab
}
)
});

Now when I want to change the tab, in the ASP.NET page button click handler I do some processing and finally set hidTabSelected = 1 (previously 0). When the page posts because I am in UpdatePanels I won't get a doc ready event. So instead I intercept the pageLoad() and attempt to set the tab again:

function pageLoad()
{
alert('pageLoad()');
var loadTab = $("#<%= hidTabSelected.ClientID %>").val();
$('#dvJqTabs').tabs( { selected: loadTab } );
}

The tab is not getting selected? If I go into console of firebug and inspect $("#hidTabSelected").val() I get 1. So why isn't the 2nd tab showing?

View 2 Replies


Similar Messages:

AJAX :: Tabs With JQuery Carousel / The First One Displayed On The Page Always Works. But Any Other Tabs Dont Work When I Select The Tab

Feb 14, 2011

I have been adding different JQuery Carousels to AJAX Tabbed Panels - the first one displayed on the page always works. But any other tabs dont work when I select the tab. I have about a dozen different carousels.

Can anyone recommend one that works in AJAX Tabs or how I can go about rectifying this?

View 1 Replies

JQuery :: Tools Tabs Doesn't Retain Tab Index On Postback

Sep 6, 2010

The graphic designer of a project I'm building a web site for chose jquery.tools [URL] for a tabs tool in the site. Unfortunately it seems that the tool doesn't behave properly on a postback in IE7 or IE8 (it does behave properly in FireFox, Chrome and Safari). Does anyone have experience using the jquery.tools with asp.net? and know how to retain the tab index on a postback? I've tried a lot of things and can't get it to work. The code i'm using now is as follows:

$("ul.tabsScenario").tabs("div.panes > div");
var tabIndex = $('#ctl00_ContentPlaceHolder1_EnInDeToekomst1_HiddenFieldTabIndex').val();
$("ul.tabsScenario").tabs('select', tabIndex);

where the tab index is stored in a hidden field (HiddenFieldTabIndex). The above code works fine in Firefox, Chrome and Safari, but not in IE7 or IE8. I am using a ScriptManager and UpdatePanels, but in an extremely simple website example I can't even get the jquery.tools tabs tool to work. There are some unanswered posts on the Jquery.Tools forum concerning this topic, but yeah, that doesn't help much. I've already determined that the jquery.ui tabs tool works well after a postback but that would cost a lot of refactoring in our project as far as html and css goes. I'd like to avoid that.

View 4 Replies

MVC :: Jquery Tabs - Second And Third Tabs Do Not Fire Any Event On Button Click?

May 24, 2010

I have created an asp.net applications in which i am using jquery tabs to show say profile modifications information. I want user to see his profile info as well as he will be able to edit his details and save the information. for this purpose i have created an aspx page "MyProfile.aspx" and 3 ascx pages

say "page1", "page2" and "page3".

When i run "MyProfile.aspx" i can see all 3 tabs showing correct information. But problem is when i edit contents and try to save them back to the database. Contents on page1 are stored correctly. But page2 and page3 doest not fire any event. In all 3 pages I am using ajax n jquery to save data to database. and when i try to save contents of page2 and page3 nothing occurs.I am showing 3 tabs there of which first tab edits save the details but second and third tabs do not fire any event on button click.

View 12 Replies

AJAX :: Can't Select Different Tabs On Toolkit's TabContainer

Oct 1, 2010

I've been searching the net for the past 3 days looking for solutions for this... but apparently it is only happening to me... As far as I've seen (even in this video: [URL], TabContainer/TabPanel is pretty much drag & drop. But for some so far unknown reason, I can't click on the tabs to change them, and I can't see the selected tab(there is no difference in the rendering of the tabs to show selected tab).

Is there any javascript function that I have to add to my page by default to make it work?

This is the way the tabContainer is being rendered:

As you can see, even though we know tab 1 is selected, the 3 buttons look the same. And when you try to click "Tab Two" or "Tab Three", it is as if the tabs were read-only...

My code is as follows... The optional properties that I setted, such as Enabled="true" on the tabpanels, are the tries I've done these past 3 days to fix the problem... And I made all TagPrefix="asp" just to make matters simple!

[Code]....

View 6 Replies

MVC :: JQuery Validation With JQuery UI Tabs Exhibiting Itself

May 12, 2010

In our application we have multiple instances of the same form in different tabs (one tab for each client). We use the MVC2 jquery validation to validate these forms, using the Html.textboxFor and Html.ValidationMessageFor elements.

The problem exhibits itself when we have two tabs. When we give wrong input in the second form (second tab), the validationmessage is shown on the (closed) first tab. It seems that the validation message is linked to the ID of the validationmessage (and thus only linked to the first form), and not to the combination of the form with the ID.

[code]....

View 1 Replies

Web Forms :: Setup The Page To Make It Look Like You Can Select Different Tabs With A MultiView

Mar 24, 2011

I've been looking for the best method to add "Tab Views" to my .ASPX web pages. I read about one method on the internet and actually remembered the other possible method from a control in the default VS2010 toolkit.

I like the <asp:MultiView> control because its so easy to use. The only thing is that it requires the page to be posted back. The second method would use CSS + JavaScript to essentially emulate tabbed views in the same webpage by changing the styles of <div> elements based upon the users tab selection, making the selected tab appear visible and the other tabs appear invisible.

I like the ease of implementation of the <asp:MultiView> but I dislike the fact that it requires the page to be posted back and resent. Also, I haven't even tried this myself yet but Im assuming there is a way to setup the page to make it look like you can select different tabs with a MultiView. Can anyone confirm this?

I like the CSS+JavaScript method of "Tab Views" because no page postback is required but it is a little more work to code. No big deal really though once its done.

View 2 Replies

Use Vertical Tabs With Jquery?

Jun 1, 2010

how to use vertical tabs with jquery. In my web site i want to use partial views i implemented it with jquery horizontal tabs but i want it with vertical tab as my links are in right side. so any one know the solution plz tel me. I am using asp.net mvc application

View 1 Replies

Jquery UI Tabs Only Reload The Tab Contents

Jun 10, 2010

<div id="example">
<ul>
<li><a href="ahah_1.aspx"><span>Content 1</span></a></li>
<li><a href="ahah_2.aspx"><span>Content 2</span></a></li>
<li><a href="ahah_3.aspx"><span>Content 3</span></a></li>
</ul>
</div>

I am using Jquery ui tabs in Ajax mode. When my page ahaha_1.aspx postbacks my main page dissapears and I am redirected to ahaha_1.aspx. How do I get it to only reload the tab and not the entire page.

View 2 Replies

MVC :: Disbale Jquery Tabs Within Controller?

Aug 17, 2010

I am using a jquery tab control with multiple tabs. I want to do some actions in my controller and depending on those actions i want to disable or enable the tabs.

View 1 Replies

Jquery Tabs Not Loading Partial Views In IE 8

Feb 3, 2011

Scenario: Loading partial views into jquery tabs(Ajax Mode) using MVC3 &Razor . Works fine in FF but not in IE8 or IE7. I can trace the ajax request & responses in firebug fine and see partial views returned from the server (containing JqGrid Html Helper methods).This loads up fine within the tab conatiners in firefox.But in IE nothing happens and i cant see any ajax requests getting fired from changing tabs when i use Fiddler.Ive tried playing around with the ajaxOptions when i initialize jq Tabs to no avail.

Ive had this problem on MVC2 and i resorted to laying the tabs contents out statically ,which i dont want this time, as i need lazy loading. Below is a full page source dump from IE8, renedered using the razor view engine. (Links to all Csss and JS libs)

<script type="text/javascript">
$(document).ready(function () {
$("#tabs").tabs();
});
</script>
</head>
<body>
<h2>Index</h2>
<div id="tabs">
<ul>
<li><a href="/"><span>Home</span></a> </li>
<li><a href="/ServicesMonitored/GetServicesMonitoredTab"><span>Monitored Services</span></a> </li>
<li><a href="/ServicesMonitored/GetServicesFullTab"><span>Full Services</span></a></li>
</ul>
</div>
</body>
</html>
From Controller:
public class ServicesMonitoredController : Controller
{
IServicesMonitoredRepository<ServiceHeaderInfo,InfoDataItem> Services;
public ServicesMonitoredController() {
Services = new ServicesMonitoredRepository();
}
public ActionResult GetServicesMonitoredTab()
{
return PartialView("ServicesMonitoredTab");
}
public ActionResult GetServicesFullTab()
{
return PartialView("ServicesFullTab");
}
#region Return Services
[HttpPost]
public JsonResult ReturnServices(string sidx, string sord, int page, int rows)
{
}

View 1 Replies

MVC :: Jquery Tabs And Posting Its Data To Controller

May 14, 2010

I am using asp.net mvc 1.0. In this I have to create an UI for modifying the profile of the user. Now this modfiy profile will contain jquery tabs. and each jqeury tab will show some results such as user's personel information, professional info, etc on seperate tabs. I also want to give user ability to modify the fields and save this modified data. I am just not getting any idea how to do that. I have searched on internet for various jquery examples. most of them are just showing data to user by creating some partial views. Also i am not getting exactly how this functionality can be achieved through ajax on click of button.

View 1 Replies

Update Panel Not Working With Jquery Tabs?

Oct 14, 2010

I am using JQuery tabs in my aspx page, but update panel is not working. If I do any operation in tab2, after posting back, tab1 is activated.

View 1 Replies

JQuery :: Make Tab Element With Tabs In A Few Rows Because In One Row Does Not Fit

Jun 16, 2010

I need to make JQuery Tab element, with tabs in a few rows, because in one row does not fit!

View 6 Replies

AJAX :: Jquery Tabs Do Lazy Loading?

Jul 9, 2010

At present I am using ajax:TabContainer for the tabs. As you know that does not do Lazy loading. Can sonone give me links to or some code examples to do Tabs with Lazy loading. I know that the Jquery tabs do lazy loading but there are no complete examples on the web which tells you on how to do lazy loading with JQuery tabs.

View 4 Replies

C# - How To Use Jquery Tabs - Ajax, And Dynamic Content Pages

Dec 22, 2010

Problem: Postbacks are causing eventtarget errors because they are going back to the aspx page where the tabs are defined instead of going to the href page. I have a main page called Default.aspx. On it is the setup for the jquery tabs using ajaxoptions.

Default.aspx javascript for tabs:

[Code]....

The dropdown is filled during the page load of lists.aspx. How can I get the postback to go to lists.aspx instead of back to the Default.aspx? I tried using IFrames and it worked great for postback issue but not for dynamic loading of pages. It loaded all pages up front which is not ok.

View 1 Replies

Jquery UI Tabs - Perform Page Navigation Without Ajax?

Feb 2, 2011

How can you perform page navigation with Jquery tabs without the ajax events firing? Following the tutorial, I added

$("#tabs").tabs({
select: function (event, ui) {
var url = $.data(ui.tab, 'load.tabs');
if (url) {
location.href = url;
return false;
}
return true;
}
});

And I added hrefs to the tabs going to other pages. The problem is, I have ajax used on the page and onload it posts to the url with an ajax call. I was hoping to disable ajax altogether for the tabs and just use them for straight navigation so I can leverage the styles.

View 2 Replies

Javascript - JQuery Tabs - Using The Cookie Option Breaks GUI

Feb 16, 2011

I've got a tabbed GUI on a webpage using:

JQuery 1.4.2
JQuery-UI 1.8.9 (full download)

The IDs for the 'pane' divs are GUIDs of domain objects in a database. Everything works as it should. But when I include the cookie option in the function call on

$(document).ready(function () {
//$("#tabs").tabs(); //Without tabs works fine
$("#tabs").tabs({ //This call with cookie option breaks everything.
cookie: {
expires: 1
}
});
});

By 'breaks' I mean - the contents of my final tab (which includes a 'submit' button) ends up being displayed at the bottom of every tabbed page although the tab itself looks fine. None of the tabs open the corresponding pane when clicked, but I can see the correct tab id in the address bar on the browser when I click a tab. I've compared the source of both pages (with and without the cookie option) and they are identical apart from the call to the JQuery tab function. But the Javascript console reports an error: cannot call method 'apply' of undefined

Is there something else I need to do to get this to work? The documentation suggests not. I've inluded the cookies plugin as suggested by Nalum, but this hasn't solved the problem. Drilling into jquery-ui-1.8.9.custom.min.js gets me the offending bit of code:

return d.cookie.apply(null,[b].concat(d.makeArray(arguments ...

This code seems to be expecting [b] to be something like ui-tabs-1 which is the way in which the tabs are IDed if you add tabs via the tabs.add(...) function. And of course I don't add my tabs this way - all my tabs have GUID IDs which are related to elements which come from a DB and are output by a Repeater control.
Some HTML below for reference:

<div id="tabs">
<ul>
<li>
<a href='#TabDiv471de30d-aaec-4485-8a50-1b2fdbc58053'>
Tab A
</a>
</li>
<li>
<a href='#TabDiv951e2fee-9272-4a8c-becb-3f3a07770347'>
Tab B
</a>
</li>
</ul>
<div id='TabDiv471de30d-aaec-4485-8a50-1b2fdbc58053'>
This is Pane A
</div>
<div id='TabDiv951e2fee-9272-4a8c-becb-3f3a07770347'>
This is Pane B
</div>
</div>

View 1 Replies

MVC :: Jquery Tabs And Sharing The Same Model For All Partial View?

Mar 8, 2011

I am implementing jquery tabs with partial views in my project.I just tried the implemention mention in this link [URL]My tabs are working very fine.. my question is how can i send the model in that viewto partial view..i think we can do it by this syntax @Html.RenderPartial("Name",ObjectModel);In the above link Kevin created the tabs with only anchor tags... it will pick the partial view and how can i send the model to that partial view....

View 3 Replies

JQuery :: How To Load Aspx Page Inside Tabs

Jan 27, 2011

At the moment, I have an aspx page with a tabcontainer (ajax toolkit). Inside each tab, I have a little form or other content. At page load, each tab is loaded. Technically I can load the tabs at tabclick (with use of update panels) but this result in unnecessary data traffic.

Is there are a way or example how to use jquery tabs that loads aspx content (html)?

This way we can still use vs.net design tool with aspx pages and load data in a much smarter way.

View 4 Replies

Way Of Creating Tabs Like Ajax Control Tool Kit In Webforms Without Using Jquery

Mar 3, 2011

I saw some example in google..and all of them with jquery...is there any way of creating tabs like ajax control tool kit in webforms without using Jquery...its not a requirement..i want to know the best way of doing it..I am very new to MVC and I know its not posibble to use Ajax control tool kit in mvc...I just noticed in this asp.net site My Profile page got some cool tabs..can anyone know how to do something like

View 3 Replies

C# - Divide Data Into Several Datasets/listview Which Are Shown In Jquery Tabs?

Sep 6, 2010

I'm extracting data from a webserivce.

This is my select statement to retrieve the data:

string cmdstr = "select title, titlefr, racpnr, racpmodeltype from onl_wgn where show = 1 order by onl_kl, racpnr";

I got 4 groups of onl_kl. Now I want to show each group in a tab of the jquery tabcontainer.

I can pass the data in a dataset from my webservice to my webapplication and databind it to a listview, but I don't know how to seperate the data into the 4 tabs? Is this possible in a way with a listview or using other datacomponents?

If not, should I make 4 select statements in my webservice and send 4 datasets to my webapplication and bind it to 4 listviews each in 1 tab? If so how I can pass a list of datasets from a webservice to a webapplication?

View 1 Replies

JQuery :: Ui.tabs.js Not Working In Visual Studio 2010 Express

Mar 5, 2011

I have a website written in html and jquery that is working fine in safari or chrome, but its iframe not working in ie8. I debug it in visual studio 2010 express, and get "Microsoft JScript runtime error: Object doesn't support this property or method" in ui.tabs.js.

View 5 Replies

Radio Button Selection On Jquery Tabs Label Click

Jan 12, 2010

I had a simple working (ASP.NET) Scenario here: 3 asp:RadioButtons that each have OnCheckedChanged event that will update an asp:gridview. But now, I want to put some description for each radiobutton selection,and I thought it would be a good idea to embed them in JQuery UI Tabs like the following :

<div id="tabs">
<ul>
<li><a href="#tabs-1">
<asp:RadioButton ID="RadioButton1" runat="server" Text="option1" Checked="True"
AutoPostBack="True" OnCheckedChanged="RadioButton_CheckedChanged" /> </a></li>
<li><a href="#tabs-2">
<asp:RadioButton ID="RadioButton2" runat="server" Text="option2"
AutoPostBack="True" OnCheckedChanged="RadioButton_CheckedChanged" /></a></li>
<li><a href="#tabs-3">
<asp:RadioButton ID="RadioButton3" runat="server" Text="option3"
AutoPostBack="True" OnCheckedChanged="RadioButton_CheckedChanged" /></a></li>
</ul>
<div id="tabs-1"> <p> content1</p> </div>
<div id="tabs-2"> <p> content2</p> </div>
<div id="tabs-3"> <p> content3</p> </div>
</div>
and the jquery is
<script type="text/javascript">
$(function() {
$("#tabs").tabs();
});
</script>

I want the corresponding radiobuttons for each tabs be selected after switching to that tab (by clicking anywhere inside that tab) I don't know how to that probably by JQuery or JavaScript

Generated HTML source :
<div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#tabs-1">
<input type="radio" checked="checked" value="RadioButtonCart" name="ctl00$ContentPlaceHolder1$g2" id="ctl00_ContentPlaceHolder1_RadioButtonCart"/><label for="ctl00_ContentPlaceHolder1_RadioButtonCart">option1</label></a></li>
<li class="ui-state-default ui-corner-top"><a href="#tabs-2">
<span style="color: Green;"><input type="radio" onclick="javascript:setTimeout('__doPostBack('ctl00$ContentPlaceHolder1$RadioButtonShetab','')', 0)" value="RadioButtonShetab" name="ctl00$ContentPlaceHolder1$g2" id="ctl00_ContentPlaceHolder1_RadioButtonShetab"/><label for="ctl00_ContentPlaceHolder1_RadioButtonShetab">option2</label></span></a></li>
<li class="ui-state-default ui-corner-top"><a href="#tabs-3">
<input type="radio" onclick="javascript:setTimeout('__doPostBack('ctl00$ContentPlaceHolder1$RadioButtonFish','')', 0)" value="RadioButtonFish" name="ctl00$ContentPlaceHolder1$g2" id="ctl00_ContentPlaceHolder1_RadioButtonFish"/><label for="ctl00_ContentPlaceHolder1_RadioButtonFish">option3</label></a></li>
</ul>
<div id="tabs-1" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
<p> content1</p>
</div>
<div id="tabs-2" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide">
<p> content2 </p>
</div>
<div id="tabs-3" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide">
<p> content3 </p>
</div>
</div>

I solved 2 problems with adding ids to anchors like id="tabsA-1" and simulating the postback for

OnCheckedChanged="RadioButton_CheckedChanged" with $("#aspnetForm").submit();
<script type="text/javascript">
$(document).ready(function() {
$("#tabsA-1").click(function() {
$("#<%=RadioButtonCart.ClientID %>").attr("checked", "checked");
$("#aspnetForm").submit();
});
});
</script>

I just have to find a way to select the right tab after postback and my problem is solved.

<script type="text/javascript">
$(function() {
var $tabs = $("#tabs").tabs();
$tabs.tabs('select', '<%= selectedTabIndex %>');
});
</script>

which selectedTabIndex is a public string var in code_behind and i update its value in page_load. one funny problem was that the .tabs( 'select' , index ) in JQuery is not zero-based index of the tab as the official site said and it start from 1.

View 2 Replies

Using Javascript Inside A Dynamically Load UserControl In JQuery Ui Tabs

Jan 25, 2011

I need to insert some JavaScript code inside a UserControl that I load from an Ajax call via jQuery Ui Tabs. Let me explain... This is my View (with jQuery loaded)

<script type="text/javascript">
$(document).ready(function () {
$("#tabs").tabs({
cache: false,
});
getContentTab (1);
});
function getContentTab(index) {
var url='<%= Url.Content("~/Home/getUserControl") %>/' + index;
var targetDiv = "#tabs-" + index;
$.get(url,null, function(result) {
$(targetDiv).html(result);
});
}
</script>
<div id="tabs">
<ul>
<li><a href="#tabs-1" onclick="getContentTab(1);">Nunc tincidunt</a></li>
<li><a href="#tabs-2" onclick="getContentTab(2);">Proin dolor</a></li>
<li><a href="#tabs-3" onclick="getContentTab(3);">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
</div>
<div id="tabs-2">
</div>
<div id="tabs-3">
</div>
</div>
With these lines of code I call the Ajax function to load the content into a DIV.
This is the Action from the controller:
public ActionResult getUserControl(int num)
{
return PartialView("TestUC", num);
}
And this is the UserControl...
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
Number... <span id="testSpan"><%=Model.ToString() %></span>!!
<input type="button" value="Click me!!" onclick="message();" />
<script type="text/javascript">
function message(item) {
alert($("#testSpan").html());
}
</script>

The problem is that the message() function returns always 1 (instead of returning the correct number). My question is... How should I add the script to my UserControl in order to have my code running correctly?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved