Showing posts with label load. Show all posts
Showing posts with label load. Show all posts

Wednesday, March 28, 2012

Tab Container Issue - Inside of Update Panel

I was attempting to have a tab container hidden (visible = false) when I load the page inside of an Update Panel. After entering in some search criteria and pressing load, the tab container would become visible, or so I thought. What I got was all of the tabs' header text just written out on one line with the first tab visible and no container. Has anyone ran into this or know a work around? Outside of that, I think this would qualify as a bug or need to be noted in the documentation that you cannot change the visibility of a Tab Container inseide of an Update Panel and expect it to work correctly.

PS. Toggling the visibility of the Tab Containers works fine when the Tab Container is outside of an Update Panel.

Hi,

I fail to reproduce the issue. Can you show me your code?

Monday, March 26, 2012

Tab control .click() method problem

Hi there,

I have a problem with my tab control. due to the nature of the content of the third tab (a google map) i need to load that tab first (map doesn't centre properly if it is not the active tab - but that is a subject for another post...). However that is not the tab i want active when the page is renders it is actually the first tab with the summary info on that I want users to see first.

So a little bit of javascript the body OnLoad event fires off the tab panel header tab's .click() method. All fine and dandy in IE but FireFox and Opera don't want to play. I assume I am calling the method on the wrong control but it looked right from digging around in the .axd files. The offending line is below:

<

bodyonload="showFirstTab();">

<

scriptlanguage="javascript"type="text/javascript">function showFirstTab()

{

if (document.all("__tab_ctl00_UserContent_AttractionTabContainer_SummaryInfoTab"))

{

document.getElementById(

"__tab_ctl00_UserContent_AttractionTabContainer_SummaryInfoTab").click();}

}

</script> Does anyone know the correct syntax, another way to achieve the same result or alternatively how to fix my Google map!

Also a good reference on the events (and order they fire) and methods would be really helpful.

Cheers,

Lucy

I believe the suspect line in your code that is causing problems is:

if (document.all("__tab_ctl00_UserContent_AttractionTabContainer_SummaryInfoTab"))

Basically IE supports this, but FireFox (and some other common browsers don't). What you should do is something more like:

var ele=document.getElementById("__tab_ctl00_UserContent_AttractionTabContainer_SummaryInfoTab");
if(ele)
ele.click();


Thanks for the reply. I had already discarded that line of code as bogus but even removing the if statement the .click() method does not work. The error returned is

the source line is:
document.getElementById("__tab_ctl00_UserContent_AttractionTabContainer_SummaryInfoTab").click();

Error:
document.getElementById("__tab_ctl00_UserContent_AttractionTabContainer_SummaryInfoTab").click is not a function

Any thoughts?

Cheers,
Lucy


Alright, here is what I figured out. Basically, I was able to get it working in the SampleWebSite. But to do it I created a button:

<

inputtype="button"onclick="DoIt();"/>

And then script:

<script>
function

DoIt() {
document.getElementById('__tab_ctl00_SampleContent_Tabs_Panel3').click();
}
</script>

This actually worked. But when I tried to do it onload, it failed. It seems you can't do that (maybe the controls aren't loaded?). I then and the onload call setTimeout(XXXX, 100) and had it call the click event in the 100ms timeout, this worked. So now I'm REALLY convinced it's a timing issue. Hope this gives you some traction.


Hi guys,

In the first post, Lucy sad about a problem with GMAP and TabPanel (map doesn't centre properly if it is not the active tab).

Are there any solution for this issue?

Thanks for helps!

Wilder Lopes
WebDeveloper
Rio de Janeiro/Brazil


Hi guys,I'm afraid the solution was lateral thinking! i.e. ditch the AJAX toolkit tab container and write my own. This is simply some HTML tags to control layout,image buttons (with javascript for mouse events - ignore the intellisense errors the page will compile fine) to do the post backs and a multiview to control the content shown. This works great - no problems with google maps now! Another bonus is that that pages load far faster now since only the data for the relevant tab is rendered on request as opposed to all of them. The down side is that there is a server request every time the user clicks on a tab as opposed to a quick javascrip show / hide on the browser. For me with data rich pages (especially that Google map!) this works out fine.Sorry no solution using the tab container itself.Cheers,Lucy
Sorry forgot to add link to see it in action:See www.ideasforthekids.co.uk for this in action. Do a search and the tabs are on the attraction page (tab graphics are being improved as we speak). http://www.ideasforthekids.co.uk/attraction.aspx?attID=7d21af2f-7c88-4e9a-82c7-85b6b5797d53

Tab Control (Doubts)

Hi Everybody...

I have a two questions:

1 - How do it does a Tab Control of the a Tab Container (Ajax Control Toolkit) to load the content, when it will only called (clicked) ? Because i have some data-sources in my page, and this leaves the slow page! (Sample: The tab Related or Preview, this forum!)

2 - How do I do a window pop-up (with drag and drop), equal the window of Contact (Send Email) this forum ??? to do the window not to leave the area of the navigator outside.

Thank all!

Felipe Oriani:

up


If you look at the thread titled "TabContainer and ActiveTabChanged" it'll tell you how to go about this

Tab Control is rendering very very slow on page

Hi,

I have added a tab control with 5 tabs on the page. But after that now page is taking very very long time to load in browser.

All of the pages where I have added Tab control are loading very slow !!

Is there any way to get rid of this ?

Regards,

Naimish Dave

Same problem here. Apparently, it's because of IE's slow javascript parser.

http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=9955

Tab Index

hai,

i had placed tab control inside multiview panel which has the view index 1.in the page load event i show only view index 0.my problem is when i click the the button to change view index to 1,tab panel does not appear properly[i.e css not applied] and active index changed event also does not fire.how can i use tab panel inside multiview with visibility set to false.

thanks in advance

Hi,

Is your tab is displaying?,,,,,or not displaying....tab is usually coming with a default css (tab__xp)...if its ok..then check your web config..is it configured for ajax supporting...i think u created your website using File->Newwebsite->Asp.net website instead of this use File->New->website->Ajax enabled website...than ajax supporting tags will automatically comes in web config...please confirm this..if its ok then check your bin folder from ajaxtoolkit dll,if its not there copy that dll to bin folder..

Prajeesh

ASP.net developer

www.prajeesh.7p.com


Hi,

My Tab Panel is displaying,When I set the visibility of the tabcontainer to true at page load.If i set false at page load it does not viewed properly.please clear me i am new to ajax.i am using ajax enabled site only.

And i have another one problem now.

I have to create tab panels dynamically at runtime from database.But when i create like this i have one dropdownlist on that page.when i fire selected index change event for that dropdown it shows error like "Specified argument was out of the range of valid values.".

what will be the problem

thanks in advance


Can u show me your code to display and dynamically adding tabs?..it will be helpful to analyse the problem..

Regards,

Prajeesh


protectedvoid Page_Init(object sender,EventArgs e)

{

LoadModuleDetails();

}

protectedvoid Page_Load(object sender,EventArgs e)

{

if (!Page.IsPostBack)

{

LoadModuleDetails();

}

}

publicvoid LoadModuleDetails()

{

objdsMenu.Reset();

objdsMenu.Clear();

objdsMenu = objEmployee.MenuMaster(13);

if ((objdsMenu !=null) && (objdsMenu.Tables.Count > 0) && (objdsMenu.Tables[0].Rows.Count > 0))

{

for (int itabcnt = 0; itabcnt <= objdsMenu.Tables[0].Rows.Count - 1; itabcnt++)

{

AjaxControlToolkit.TabPanel TabPan =new AjaxControlToolkit.TabPanel();

TabPan.HeaderText = objdsMenu.Tables[0].Rows[itabcnt]["ModuleName"].ToString();

GridView grdPMS =newGridView();

//grdPMS.AutoGenerateColumns = false;

//BoundColumn bndmenuid = new BoundColumn();

//bndmenuid.HeaderText = "Menu ID";

//bndmenuid.DataField = "MenuID";

//grdPMS.Columns.Add(bndmenuid);

TabPan.Controls.Add(grdPMS);

TabContainer1.Controls.Add(TabPan);

}

//objds.Clear();

//objds.Reset();

//objEmployee.ParentID = 9;

//GridView grdPMS =(GridLines)Page.FindControl("grdPMS");

//BindMenuGrid(grdPMS);

}

}


Please give me source of aspx code also.....

Saturday, March 24, 2012

Tab Problem

Iam listing some records in a datalist inside a tab control...when the page load all tab options working perfectly.when i click first tab "client records " listed and when iam click second tab "product records" listed...my problem is...i have placed a dropdown in first tab for search option .this dropdown is set "autopostback" =true.during page load all tab easily work..but when i selected dropdown for searching, the tab controls "borken"..how can i solve that problem.please help me.....

by anish

Hi Anish,

I don't quite understand what do you mean by "broken" ? Can you elaborate it?

It will be better if you can provide a simple repro that uses NorthWind database.

TabContainer - ActiveTabIndex not matching ActiveTab

I'm not sure if anyone has seen this, but I am experiencing the following:

I have a tab container when several (8) tabs.

On page load, I dynamically set the "Visible" property of particular tabpanels based on database values (security schema for what a user can see). Along with setting the visibility, I also set HeaderText = "" so that nothing renders at all.

The problem I am having is that if I set the first tabpanel (index=0) to not be visible, then the TabContainer seems to incorrectly associate ActiveTabIndex and ActiveTab. For instance, the container will correctly identify that the ActiveTabIndex = 2 (third tab), but the ActiveTab is referencing the second tab (incorrectly). It is as if setting a tabpanel to be invisible causes a mismatch between ActiveTab and ActiveTabIndex.

Has anyone else experienced this? It is not very hard to replicate, I am wondering if this is a bug with this control?!?!?!?

Thanks, in advance!

-Jim

Can someone replicate this issue? It should only take a few minutes...

I need to know if I am doing something wrong or if it is a bug in the control...


Hi,

I think that when a tab is set to visible="false", it does not get rendered to client. So, the next tab does get an index of 0. Sounds logical to me like that..

Maybe you could use Tabcontainer.ActiveTab = [id of tab] instead of index?

TabContainer + UpdatePanel + UpdateProgress + OnClientActiveTabChanged - No progress gif..

Hey all,

I'm using a combinaison of TabContainer + UpdatePanel + UpdateProgress + OnClientActiveTabChanged to dynamically load the content of each TabPanel on user selection.

Everything works fine except the UpdateProgress which does nothing!

I have written a ActiveTabChanged(sender, e) function do actually do a post back for the OnClientActiveTabChanged method. like this :

function ActiveTabChanged(sender, e) {__doPostBack('<%= TabContainer1.ClientID %>', sender.get_activeTab().get_headerText()); }

My problem at the moment is that it does not fire the UpdateProgress control.

I tried to add an hidden asp:button within each TabPanel and fire their event in javascript but as I realised, it only work for the Activated tab, since the Tab controls are not loaded until they are active...... which is after the OnClientActiveTabChanged....

Anyone have any idea of how this can be achieve ?

Many thanks

Rich

I was wondering if anyone knows where the poster above learned what properties/values were exposed by the "sender" parameter sent into the active tab changed event we can specify on the clientside. I did try the sender.get_activeTab().get_headerText() above and it does indeed work. I'm wondering what else is exposed via this parameter and if it is documented somewhere?

Thanks

Wednesday, March 21, 2012

TabContainer and OnActiveTabChanged

Hi,
I read a lot of posts about the OnActiveTabChanged event but I would like to know what would be the best way to load dynamically the content of the selected Tab.
Here's my needs.
I have a tabcontainer with 3 tabs and I want to load the content on fly when the user selects a tab (of course without reload the entire page).
If someone could post the right code, that will be great.

Thanks in advance.
Stan

I think the best way to do this is to:

1) Put an UpdatePanel around the TabContainer

2) Hook the ActiveTabChanged event

3) When it fires for a given tab, add the content in the postback

Note there is a known issue with the TabContainer in an update panel - it's a cosmetic issue where you can see it redraw on postback.


OK I sat down and did a sample of this that loads each panel when the user selects it.

http://blogs.msdn.com/sburke/archive/2007/06/13/how-to-make-tab-control-panels-load-on-demand.aspx

TabContainer AutoPostBack. Load the tabPanels only when needed

Greetings!I have a TabContainer with various tab.

Each tabPanel contains a Gridview that contains different data. This way, each time the page loades or makes a postback ALL the gridviews perform the data access.

In order to increase performance at the first page_load, I want that the methods that load the Gridviews excecute only when the tab is activates. The solution that I tried was to capture the ActiveTabChange event. The problem is that the TabContainer doesn't have any AutoPostBack-like property.

Any ideas=

Hello,

There's a function on the TabContainer called OnActiveTabChanged


If you READ (yes READ) my post, you will see that I know that there is that event, and I also say that it doesn't solve by its own my problem. Yes I do capture that event and code the data access there. But when the user clicks on a tab, this event doesn't fire up, because this events activates on postback (for example, if anyone clicks a button).

Pleas avoid answering if you don't read the entire post.

Anyone with REALLY helpful ideas?


Oops, sorry. I guess I must have skipped that line of yours. Cheer.

TabContainer disable problem

I have a tabcontainer. And I want to implement a feature: when the first time I load the page, it's diabled, but after I elect a checkbox, it will be enabled.

So I have code in the my page file like below:

<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" enabled="false">

And in my javascript file, I get the tabcontainer, and set its disable property to false. Yes, I can see in the page, the control is enabled (not gray out), but I cannot operate on any control inside it. For instance, the tab contains a textbox, but whatever what I do, the textbox cannot get focus. Any opinion on that?

Disabling the tab container will also disable all controls inside of it (this is the correct behavior). I'm guessing you want to disable clicking of the tabs until after the checkbox has been clicked. I suggest exposing a new public property to disable the clicking of the tabs.


Yup, if disable the tab it should also disable all controls contained by the tab. But I think after enabling the container, all controls in the tab should be editable, like Winform does.

bluemistonline:

Disabling the tab container will also disable all controls inside of it (this is the correct behavior). I'm guessing you want to disable clicking of the tabs until after the checkbox has been clicked. I suggest exposing a new public property to disable the clicking of the tabs.

What do i have to do, to expose a new property for the tab? I need the functionality to disable a tab (greyed out) and to add tooltips for a tab.

Can somebody show me an example?


Can somebody help me with this issue, please. Release date is comming closer and closerBig Smile

TabContainer is get back to the first tab each page load

who to fix it?

<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" Height="150px" ActiveTabIndex="0"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="???? ????" > <ContentTemplate> <uc1:Clientdetails ID="Clientdetails1" runat="server" /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="?????"> <ContentTemplate> <uc2:CommentsList ID="CommentsList1" runat="server" /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="??????"> <ContentTemplate> <uc3:ClientsOrder ID="ClientsOrder1" runat="server" /> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer>

is there other easy way to do it except using session

is there other easy way to do it except using session>?

well i am kinda new to this myself. But i think removing the ActiveTabIndex="0" property might help, since every page refresh it reads that property again and set the active tab to 0. Thus your first tab.


Hi Roy,

I'm afraid the information you provided isn't sufficient enough to solve it.

I copied your code into my page, but can't reproduce it.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" Height="150px" ActiveTabIndex="0"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="???? ????" > <ContentTemplate> <asp:Button ID="Button1" runat="server" Text="Button" /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="?????"> <ContentTemplate> <asp:Button ID="Button2" runat="server" Text="Button" /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="??????"> <ContentTemplate> <asp:Button ID="Button3" runat="server" Text="Button" /> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> </form></body></html>

TabContainer inside UpdatePanel

Hi i have a TabContainer inside my UpdatePanel and when i try and load the tabcontainer inside the update panel the formatting disappears. The Tabcontainer still works i can move between the tabs but the background behind the tabs is not there only the header text for the tab and the content of the tab itself no background for the body. If i take out the update panel then the tab container works fine.

The heirachy of my page is

Main form -> Usercontrol -> UpdatePanel -> TabContainer -> Tab Panels

Any help on this would be great as i have been searching for days now and cannot find an answer.

This seems to be a bug (as far as I can see on the codeplex site) and will be corrected in the next release. The problem is the the webresource.axd is not loaded when tabcontainer is inside an updatepanel. As a workaround what u can do is place a tabcontainer outside the updatepanel (I have placed it in my masterpage) and use a div styled with display:none surrounding the tabcontainer to make invisisble.

Like so:

In my masterpage

....

<div style="display:none;">

<ajax:TabContainer runat="server"></ajax:TabContainer>

</div>

</html>


I forgot to say that this makes your actual tabcontainer (the one inside an updatepanel) display the formatting correctly...

Hope it helpYes
Thanks heaps jole. That has worked perfectly. I have been struggling on this issue for days so very relieved

I am having the same issue and I also tried your solution. It did not work for me. I tried adding another TabContainer to my page but that did not solve the problem. I was hoping you had another solution :) My problem actually causes a javascript error; "Error: this.get_element().style' is null or not an object". Any help or ideas would be greatly appreciated.