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
Similar Messages:
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
Feb 9, 2011
I'm trying to generate jquery vertical tabs using jquery template. I use this code :
[Code]....
Everything works greate on Firefox, Chrome, Opera and Safari but in IE this code doesn't work. When i looked on html source i saw that in IE instead on
[Code]....
I get
[Code]....
Because of this jqury vertical tabs doesn't work on IE.
View 2 Replies
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
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
Aug 14, 2010
I have a small website where I want to display a confirmation dialog after clicking on a button.
When you click the confirmButton the dialog appears. Then you can choose between Yes or No to either continue with the PostBack or to return.
Problem: The first time you get into the site all works fine. But after you click Yes to continue with the PostBack, no click event will be triggered anymore.
Here is some code.
[Code]....
View 8 Replies
Sep 14, 2013
I have a gridview based on two dropdown lists. The first list limits the values of the second dropdown list. On page load all available results are inserted into the gridview. After selection of the dropdown list, the gridview is refreshed with data limited to the two selections. This will result in 200 rows of available data. The user can select the page they want to go to using the page index.
They will then select the row to edit. Everything is fine up to here. Then the user will update the record with the appropriate data from the dropdown lists in the gridview or update the text box as necessary. They hit the update selection and the row is updated. The only problem is that they are brought back to the first page in the index. Since most of these people will be working through the list relatively in order, it would be nice if they could stay on the page they were working on rather than going back to the beginning every time. Is there a way to go back to the same pageindex they were at when they started the update?
I am including my code. I tried to use a variable for the pageindex as well as the selected values of the dropdown lists but I am quite sure I have applied them in the wrong places.
aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Trakker.aspx.cs" Inherits="AnnoTracker.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
[Code] ....
View 1 Replies
May 26, 2010
Cascading html select server control, jQuery does not retain value on post back
View 4 Replies
Mar 17, 2010
I have an IEnumerable< T> which is declared on the page like this:IEnumerable< Person> person;When the page postsback, the person list is null. How can I retain the values of person list without declaring it as static? Sr. devs in my company say that you should not declare the list as static.
View 2 Replies
Aug 19, 2010
Right now I have an asp:Wizard with 3 Steps.
Create User
Form to Email
Summary of Fields
When the finish button is clicked on the third step I would like to Create the user and send the form. I have the logic for this written but the only problem I have is the when the next button is pressed on a wizard, a PostBack occurs and my password field:
<asp:TextBox ID="txtPassword" TextMode="Password" Width="70%" runat="server" />
Does not retain its value.
View 2 Replies
Mar 27, 2010
I have seen many posts here regarding this, but none with a successful solution.I m using a asp.net fileupload control & not the html one.I have various controls on the page, & on a listbox control, listitem selection, page postbacks.So before it, if i had selected a file for upload & page poastbacks, the the file goes off.Now on postback, I have got the filename in a hidden field, but since the Fileupload control doesnt have any setter methods, not able to get how to set the hidden field value & how to set it...
View 2 Replies
Jul 23, 2010
How can we retain Panel scroll position on postback without using any cookies.
View 6 Replies
May 14, 2010
We currently have a page with several user controls (8 of them) and when a control that is contained in an updatepanel initiates a postback the focus is not retained. In some cases, it looks like the focus is sent to the top of the page, and in other cases the focus looks like it is sent to the control with the TabIndex=1.
I have tried 3 different solutions and they all end up with the same result.
The first two were from article:
[URL]
Solution 1: At the end of the server event executed in postback, add:
[Code]....
The article says both of those solutions worked, but for us, neither of them did.[Code]....
ASPX.CS
[Code]....
[Code]....
In all 3 scenarios the control we want to have the focus gets the focus for a split second and then the focus is cleared (set to the top of page, or TabIndex=1).
View 3 Replies
May 7, 2015
I have a grid view which is costomized.I upload a image in this,when i click edit button then give error (Specified cast is not valid.)
<td align="center" rowspan="11" style="width: 130px" valign="top">
<asp:FileUpload ID="FileUpload4" runat="server" Width="100px"
Enabled='<%# bind("imagePath") %>' />
<asp:Label ID="lblimage" runat="server" Text='<%# Bind("imagepath") %>'
Visible="False"></asp:Label>
</td>
View 1 Replies
Nov 15, 2011
I have a ASP.Net FileUpload control in my page. Once the File is uploaded I want to display the path in FileUpload control
View 1 Replies
Feb 18, 2014
I am using string builder class to store the dropdown selected values .. I am doing this on the selected index change event .. The problem is the previous value does not retain ..
sb.Append(degreedropdown.SelectedValue+"-");
string nums = sb.ToString();
string pattern = "-";
string[] substrings = Regex.Split(nums, pattern);
arraylength = substrings.Length;
View 1 Replies
Jan 25, 2011
everytime the user selects a date from my datepicker the for some reason instead of staying focused on the are the date picker is in it scrolls to the top of the page.
Heres the function located at the bottom of my asp.net page under the
<script>
$(function() {
$( "#<%= pissued1.ClientID %>" ).datepicker();
});
</script>
This is the code.
<td align="left" colspan="2">
<strong>
<asp:Label ID="labdi1" runat="server" Text="*Date Issued:"></asp:Label>
<asp:RequiredFieldValidator ID="p1divalidate" runat="server" ControlToValidate="pissued1"
ErrorMessage="You Forgot The">*</asp:RequiredFieldValidator><br />
</strong>
<asp:TextBox ID="pissued1" runat="server" Width="45%"></asp:TextBox>
</td>
and also on postback my datepickers stop working. For example i have a dropdownlist that causes postback and if the user uses the drop downlist then the datepickers stop working
View 1 Replies
Nov 20, 2010
This is a problem I'm facing in a webapp I'm currently working on. So instead of cluttering the question with unrelated code, I recreated the problem in an isolated, simplified webapp that only demonstrates this issue.
I have a web user control with just this as its content:
<% if (ShowAlertScript)
{ %>
<script type="text/javascript">
function AlertMe()
{
alert('Hello World!');
}
</script>
<% } %>
<input type="button" onclick="AlertMe()" value="Say Hello" />
And its codebehind has nothing more than the boolean definition of ShowAlertScript. This represents a control I have in the big webapp that has two modes: input mode, and display mode. When in input mode, it has a large javascript block that is only useful then; it does some cool stuff to help the user input the info.The way this control is laid out in the big picture is as follows:
<asp:ScriptManager runat="server" />
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:MultiView ActiveViewIndex="0" runat="server" ID="mvw">
<asp:View runat="server">
<asp:Button runat="server" ID="btnSwitch"
OnClick="btnSwitch_Click" Text="Switch" />
</asp:View>
<asp:View runat="server">
<uc:MyInputControl runat="server" ID="micInput" ShowAlertScript="true" />
</asp:View>
</asp:MultiView>
</ContentTemplate>
</asp:UpdatePanel>
When you click btnSwitch, it simply switches to the second view with the user control. Notice how I have the ShowAlertScript already initialized to true. The potential output is that since I'm "showing the alert script" within the user control, the AlertMe() function will execute when you click the input-button element, because it's written out according to the inline if statement.
If you run this code I gave you so far as is, it will not work. The browser will say it can't see the AlertMe() function; it's undefined as far as it knows. But if you take out the UpdatePanel (or disable the ScriptManager's partial rendering), it will work just fine on a full postback when you click btnSwitch.
I want it to work on a partial postback, because this whole thing is a small piece compared to the rest of the page, and I don't want to do a full postback every time they switch views. Apparently, the ScriptManager doesn't even bother re-rendering the ascx file for possible changes. Either the ScriptManager is not smart enough, or there is an option I'm missing to let it render the <script> so I can invoke its methods on the client side. A potential answer someone might suggest is "why don't you take out the javascript, put it in its own .js file, and have the page reference it so it's available to the control?"
That won't really work with me, because the script block does some initialization and modification that pertain to that single control instance, not to all others on the page.
In turn, you might also be concerned that if I have more than one instance of the control, I end up with copies of the same script. Not really; there will only be ONE input mode of this control in a page at any given time, it's just that I have those two modes in two separate views and I let the user switch between them.
View 2 Replies
Nov 22, 2010
I am having an aspnet panel in my aspx file.There is an ultraweb tab placed inside this.also I am having a button outside this panel.Within the tab I have a textbox whose readonly property is
set to "true".Whenever I click the button a javascript function is called .On clicking 'OK' in the popup ,the textbox values are lost.Is there a way to retain these values?
View 5 Replies
Jul 24, 2013
I have the example working but I added a Select Command to the Detail grid for the purpose of selecting a detail record which will redirect to another page. The problem is that when the Select command is clicked the expanded detail grid collapses as if I had clicked the minus. The page and codebehind are:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Search1.aspx.vb" Inherits="iDCA.Search1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
[code]...
View 1 Replies
Jan 12, 2011
I used ajax tabcontainer and 7 tabs in it.It works fine on my locahost but when i deployed it on server it doesn't show tabs background..it shows only labels as tab names.
View 1 Replies
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
Mar 22, 2010
In my project when i click any button or linkbutton, it doesnt fire any event or doesnt postback.
It was working fine but now it hv problem like this.
I think i have changed some settings by mistake.
View 5 Replies
May 7, 2015
I have a dropdown populated with data , based on a true / false condition i change the dropdown item color when dropdown gets loaded initially the item color are proper based on condition. but if i select a particular item & then again click on dropdown the item color disappear show to retain the item color.
View 1 Replies
Nov 8, 2010
I know this has been asked before, but I feel like I'm losing my way trying to follow the other examples out there. Does anyone see a straightforward solution to my particular problem?
Goal:
Two column Master Page
Left column contains a list of [stuff] (I'm trying a Repeater with LinkButtons)
Right column contains a TabContainer which will add dynamically created tabs when buttons on the left are clicked.
Left side looks like this:
<asp:Repeater
<ItemTemplate>
<asp:LinkButton ID="lbShowReport" runat="server" Text='<%# Eval("Title") %>' CommandName="Select">
</asp:LinkButton>
<asp:HiddenField ID="hfReportID" runat="server" Value='<%# Eval("Id") %>' />
</ItemTemplate>
</asp:Repeater>
I had initially been creating tabs in the LB's OnCommand event, but of course this means that any tab generated by one click is lost if the user clicks another LinkButton.
So I moved the code to create a new tab to the OnInit section of the page and attempted to loop through the RepeaterItems comparing the UniqueId of each LinkButton until I found the one that was clicked using Request.Form["__EVENTTARGET"].
When I tried to loop through the RepeaterItems, however, the count was always 0, and the Repeater would not populate.
So now I am rebinding the Repeater in the Init section on every post-back - this allows me to find the LinkButton that was clicked. I then add the new Tab based on the LB that was clicked like this:
[Code]....
This properly adds new Tabs to the TabContainer using this code:
[Code]....
but I still have the issue where I can only ever have one dynamically created tab in the TabContainer at a time. All of the code above is being executed in OnInit, which I thought would save the tabs during post-backs, but instead this is behaving as tho I was adding the tabs in the OnCommand event of the Link Button...
View 3 Replies