Showing posts with label controls. Show all posts
Showing posts with label controls. Show all posts

Wednesday, March 28, 2012

System.Web.UI.UserControl does not have a public property named Title.

The controls work but I cannot view them in designer I get an error:

Error 1 Content1:Type 'System.Web.UI.UserControl' does not have a public property named 'Title'. D:\asp.net\Atlas\SampleWebSite\ModalPopup\ModalPopup.aspx D:\...\SampleWebSite\

I saw another post that said to rebuild, but I tried that and it didn't work.

thanks!

Nevermind... found the answer to remove the collapible panels. Wait until next release.

System.Web.UI.ScriptManager not recognized

Hi All,

First of all I am new to using Ajax controls, and am having a bit of trouble trying to add them to an exsisting ASP.NET application.

I am using:

Windows Vista Business

IIS7

VS 2005 SP1

AJAX 1.0

When trying to add an Ajax script manager to a page i get an error in the designer.vb file saying that the System.web.ui.scriptmanager type is not recognized. Also when I try to run the app I get the "sys is not found" javascript error which I would expect is related to my issue.

I have searched the fourms etc for quite a while and have found one other post regarding this, although it didn't seem to solve my problem.

I have tried running a Ajax enabled project and tested it in both the VS and IIS webservers which works well. I have also copied a web.config file from an Ajax enabled site so I dont think it is the web.config file.

Could anyone shed some light on this?

Thanks in advance.

Glen

http://www.emmersivemedia.com.au

First of all When u create "AJAX Enabled Site", You don't have to manually include

ScriptManager Control. It will be automatically placed on the form.


Why do you want to place ScriptManager manually ?

You can use directly AJAX Enabled Web Site..


Hi Chetan,

I am adding Ajax controls to a "Standard" ASP.NET application and not a Ajax enabled app, when adding the control which i want to use (ModalPopup) it says that it requires an instance of the ScriptManager Control on the page which makes sense as to my understanding any page that uses Ajax controls needs a ScriptManager control or a ScriptManager Proxy.

The reason I mentioned the Ajax Enabled site is that I guess it illustrates the fact that its not a problem with the instalation of Ajax but rather an issue specifically with the app i am working with.

Can you think of anything that I might have missed that would cause this to happen?

Thanks again for your help.

Regards,

Glen

Tab and Enable

Hello

I′m using the tab component and i would like to know how can i disable all the controls inside a tab automatically avoding editing.

Best regards,

Borja

could you not just loop through all the controls in the tabcontainer?

for each ctl as Control in tabcontainer.controls

ctl.enable=false

next

?


What′s the difference between enable and visible in the tab?


I believe enable=false will just gray out the tab and make it unselectable, where as visible=false will make it disappear completely.


Put all the controls you want to disable in a panel for example, and disable the panel? All the controls inside it will be disabled..


As he said, disabled controls (enabled=false) will be grayed out, while controls with visible=false will not be visible at all for the user. Which is also not the same as using style="display:none;" nor style="visibility:hidden;"... If you are gonna toggle between hiding and showing stuff, I recommend the last techniques as you can show/hide simply with css. (don't use style="", but rather define it in css if possible)

tab container: tab panel appears but not the controls in it

Hello,

I have a ajax tab container with 4 tab panels. each panel has arround 30 to 40 controls.later I added another(5th) panel with text box control. The new panel appears, but the control in it is not displayed.

When I tested again with a new file,new tab container, with 7 to 8 panels with no controls. I just added 1 single control to 8 th panel. This time it displays properly.

I am unable to figure out whether it is problem with tab container control, because it has too many controls? I am using ajax control toolkit version 1.0.10301.0.

(or)

problem with the html content I wrote.Here is my code.Pls help.Its urgent

<divid="divMain"style="overflow: auto">

<cc1:TabContainerID="TabContainer1"runat="server"Visible="true"ActiveTabIndex="2">

<cc1:TabPanelID="tpCallHandling"runat="server">

<HeaderTemplate>

Call Handling</HeaderTemplate>

<ContentTemplate>

<tablewidth="98%"style="height: 98%">

<tr>

<tdalign="center"colspan="5"class="aimTableH">

<asp:Labelrunat="server"ID="Label29"CssClass="aimth2"><b> Call Handling</b></asp:Label></td>

</tr>

<trclass="aimTableH"align="center">

<td>

<asp:Labelrunat="server"ID="lblEscalate"CssClass="aimth2"><b>Escalate</b></asp:Label>

</td>

<td>

<asp:Labelrunat="server"ID="Label1"CssClass="aimth2"><b>Lead Type</b></asp:Label>

</td>

<td>

<asp:Labelrunat="server"ID="Label2"CssClass="aimth2"><b>Maximum Attempts</b></asp:Label>

</td>

<td>

<asp:Labelrunat="server"ID="Label3"CssClass="aimth2"><b>Word Tracks</b></asp:Label>

</td>

<td>

<asp:LabelID="lblEmailRecipients"runat="server"CssClass="aimth2"><b>Email Recipients</b></asp:Label>

</td>

</tr>

</table>

</ContentTemplate>

</cc1:TabPanel>

.

.

.

.

.

.

.

<cc1:TabPanelrunat="server"ID="TabPanel2">

<HeaderTemplate>TESTING</HeaderTemplate>

<ContentTemplate>

<tablewidth="98%"height="100%">

<tr>

<td>

<asp:TextBoxrunat="server"ID="txt1"></asp:TextBox>

</td>

</tr>

</table>

</ContentTemplate>

</cc1:TabPanel>

</cc1:TabContainer>

</div>

<tablewidth="98%"height="100%">

In bold, that is an error... Style="height:98%" is an error too...

My guess is maybe your controls are hidden by the table...

Another tip: if you have too many controls in each tab, maybe try seperating the contents into iframes... Easier to debug..

Monday, March 26, 2012

Tab Control and Calendar control together

Hello

I am using the new Tab control of Ajax together with the Calendar control.
When using the 2 controls seperately, both work perfect.

When using them together however, I get a javascript error (Error on Page) when clicking on the TextBox field.

Here is my code... anyone can solve this problem??

<toolkit:CalendarExtenderID="CalendarExtender1"runat="server"TargetControlID="myTabContainer$myTab1$txtDate"></toolkit:CalendarExtender>

<toolkit:TabContainerID="myTabContainer"runat="server"Height="300">
<toolkit:TabPanelrunat="server"ID="myTab1">
<HeaderTemplate>Data</HeaderTemplate>
<ContentTemplate>
<form>
<p><asp:LabelID="lblDate"runat="server"Text="Date:"CssClass="label"></asp:Label>
<asp:TextBoxID="txtDate"runat="server"CssClass="short_input"></asp:TextBox></p>
</form>
</ContentTemplate>
</toolkit:TabPanel>

Hey,

Why not just stick it in the content template directly, and reference the ID directly? That, I think, would alleviate the problem.


Nice try but that didn't work neither... :-(

I have found my stupid error...

I had forgotten to reference the masterpage/contentpage itself ! :-)

tab control and modelpopup

In my form aspx page, I have three panels, top of the page I have three input buttons controls how I display my panels, first button display panel1(hides panel2 and 3) , second button displays panel2(hides panel1 and panel3), third panel display panel3(hides panel1 and 2).

Only thing is, panel2 has one small subpanel and datagrid in it that for datagrid, I put a modelpopupextender , because I wanted when user clicks linkbutton inside the datagrid, I make modelpopup pops. That means it I have update panel inside the Panel2 already.

I have tried some javascript functions for displaying/hiding my panels when buttons are clicked, but I needed also for panel2 when user saves datagrid, page refreshes and needs to comes back to show panel2 again,it was keep showing panel1, I put some javascript for that would remember last button clicked, so could come back that one, but that gives me some problem, so maybe I should try Ajaxs Tab , but I get confused how would I set up that, because I already have updatepanel inside the panel2 for modelpopup, so how would I can put tab control for whole form? Would it effect Tab and modelpop up together ?

Any suggestions?

Hi,

I agree your idea of trying to use TabContainer control. With it, you don't need to worry about keep its state between postbacks.

For more information about how to use it, I'd suggest downloading the sample web sitehere and try the tabs page.

Tab Control Not working Properly in Update Panel.

I am having one update panel. inside that having some ASP Controls and a Tab Control. Now whenever this Update panel tries to Update, My tab control gets disappeared. It is not displyaed on the page.

Can you elaborate on what you are trying to do eg.

UpdatePanel -> Tab Container -> Tab - Some ASP.NET controls

Also, are you doing this in the Designer in Visual Studio? ie drag and drop designing.? otherwise?


Hi mistry,

To indicate the real problem, your source code is needed.However , here is the url that has a sample shows how to use these controls (Please focus on the source code). Hope it helps.

http://forums.asp.net/p/1128124/1784927.aspx#1784927

If your problem is still exist, please let me know.


Hi,

I tried what you described, it worked fine. Here is my code:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToString(); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2"> <ContentTemplate> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> <asp:Button ID="Button1" runat="server" Text="Button" /> </ContentTemplate> </asp:UpdatePanel> </form></body></html>
You may compare it with your code to find out the reason.

Tab Control with ASP.net control

Hello there,

I am trying to put some server controls such as label, textbox and dropdownlist on AJAX Tab control but these controls not responding to any events like button onclick event. How can I write code to handle and work with these server controls while it is on the AJAX Tab control?

Please help...

Best regards,
Sam

can u post ur code.. here..


actually I have no code till now i am just placed the button control on the AJAX tab and I am trying to wire onclick event with this button but it is not working. and the other thing is the control propertis is not working like i set the max length propertis to 200 char but the textbox still accept more than 200 char.

Thank you

Sam


Hi Htaher,

Based on your description, what you want is when click on the server control no postback will be occurred. If I have misunderstood, please feel free to let me know.

For your situation, you may use HTML Controls instead of the server controls.If you insist on using server controls, please forbit the controls to postback.

For example: If it is a Button control, you can use this: <asp:Button ID="Button1" runat="server" Text="Calendar" OnClientClick="return false;"/>

If it is a DropDownList Control , you can set it's AutoPostBack to "false". Just like this:

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="false">
</asp:DropDownList>

I hope this help.

Best regards,

Jonathan

Tab control wont see script manager on page

I have a master page setup. I have no Ajax controls in the masterpage at all, I am doing this purely in the content page. I am using Ajax 1.0 and the toolkit. I did install the CTP just in case it was looking for something there but it didn't help.

I am using a existing project that had no ajax setup originally. I edited the webconfig file and added all the relavent sections except the bit about IIS 7 which I am not using and the webservices which I am also not using.

I add a script manager and an update panel. The update panel is working perfectly. I then add a tab container and a tab panel from the toolkit and the tab panel gives me an error saying a script manager is required on the page. I tried moving the scriptmanager to the masterpage itself based on a few posts I saw here but it didn't make any difference.

Here is the source code. I removed most of the excess code so you could see the control placement without too much confusion.

<%

@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/Master1.master"AutoEventWireup="false"CodeFile="InvComputerRpt.aspx.vb"Inherits="Inventory_InvComputerRpt"title="IT Report" %>
<%@dotnet.itags.org.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>
<%@dotnet.itags.org.RegisterAssembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"Namespace="System.Web.UI"TagPrefix="asp" %>

<asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">
<asp:ScriptManagerid="ScriptManager1"runat="server"></asp:ScriptManager>

<cc1:TabContainerID="TabContainer1"runat="server"></cc1:TabContainer>
<cc1:TabPanelID="TabPanel1"runat="server"></cc1:TabPanel><asp:MultiViewID="MultiView1"runat="server"ActiveViewIndex="0">
<asp:ViewID="View1"runat="server"><asp:UpdatePanelid="UpdatePanel1"runat="server">
<contenttemplate>
<asp:CheckBoxListid="CheckBoxList1"runat="server"></asp:CheckBoxList>
<asp:DropDownListid="ddlDept"</asp:DropDownList>
<asp:DropDownListid="ddlCat"runat="server"</asp:DropDownList>
<asp:GridViewid="GridView1"runat="server"></asp:GridView>
</contenttemplate>
</asp:UpdatePanel>

</asp:View>
</asp:MultiView>
</asp:Content>

Here's a version of your sample that runs fine in the SampleWebSite that comes with the Toolkit (note that TabPanel belongs inside TabContainer):

<%@. Page Language="C#" MasterPageFile="~/DefaultMaster.master" Title="Untitled Page" %><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><asp:Content ID="Content1" ContentPlaceHolderID="SampleContent" runat="Server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <cc1:TabContainer ID="TabContainer1" runat="server"> <cc1:TabPanel ID="TabPanel1" runat="server"> </cc1:TabPanel> </cc1:TabContainer> <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0"> <asp:View ID="View1" runat="server"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:CheckBoxList ID="CheckBoxList1" runat="server"> </asp:CheckBoxList> <asp:DropDownList ID="ddlDept" runat="server"> </asp:DropDownList> <asp:DropDownList ID="ddlCat" runat="server"> </asp:DropDownList> <asp:GridView ID="GridView1" runat="server"> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> </asp:View> </asp:MultiView></asp:Content>

Hi David,

Thankyou, moving it between the container tags helped. I should have mentioned I was using Web Developer Express. I don't know if the behaviour is different in VS2005 but part of the problem was the designer not showing anything either so I didn't think it was working. Now I twigged that I am editing the source code to set my page up.

Regards

Victoria

Tab Controls and CssClass Not Working

I have been working with the tab Control for two days with no success at overridding the default styles for the tabs. I have copied the styles from the tabs.css file located in the toolkit, and have modified the hover, active and selected styles that I want to modiy. I have included the new css sheet into my application and included the CssClass reference in the file code. when I run the page or site to debug I get the default images and actions. Could anyone tell me what is wrong. I'm including the source code below:

ASP file

<%@dotnet.itags.org.PageLanguage="VB"AutoEventWireup="true"CodeFile="Default.aspx.vb"Inherits="_Default" %>

<%@dotnet.itags.org.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

<linkhref="Tabs.css"rel="stylesheet"type="text/css"/>

</head>

<body>

<formid="form1"runat="server">

<asp:ScriptManagerID="ScriptManager1"runat="server"/>

<div>

<cc1:TabContainerID="TabContainer1"runat="server">

<cc1:TabPanelID="TabPanel1"runat="server"CssClass="ajax__tab_tab1">

<HeaderTemplate>DashBoard</HeaderTemplate>

</cc1:TabPanel>

</cc1:TabContainer>

</div>

</form>

</body>

</html>

Style sheet

/* default layout */

.ajax__tab_default.ajax__tab_header {white-space:nowrap;}

.ajax__tab_default.ajax__tab_outer {display:-moz-inline-box;display:inline-block}

.ajax__tab_default.ajax__tab_inner {display:-moz-inline-box;display:inline-block}

.ajax__tab_default.ajax__tab_tab {margin-right:4px;overflow:hidden;text-align:center;cursor:pointer;display:-moz-inline-box;display:inline-block}

/* tab1 theme */

.ajax__tab_tab1.ajax__tab_header {font-family:verdana,tahoma,helvetica;font-size:11px;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-line.gif")%>)repeat-xbottom;}

.ajax__tab_tab1.ajax__tab_outer {padding-right:4px;background:url("Images\green_gradient_3.gif")no-repeatright;height:21px;}

.ajax__tab_tab1.ajax__tab_inner {padding-left:3px;background:url("Images\green_gradient_1.gif")no-repeat;}

.ajax__tab_tab1.ajax__tab_tab {height:13px;padding:4px;margin:0;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab.gif")%>)repeat-x;}

.ajax__tab_tab1.ajax__tab_hover.ajax__tab_outer {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-hover-right.gif")%>)no-repeatright;}

.ajax__tab_tab1.ajax__tab_hover.ajax__tab_inner {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-hover-left.gif")%>)no-repeat;}

.ajax__tab_tab1.ajax__tab_hover.ajax__tab_tab {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-hover.gif")%>)repeat-x;}

.ajax__tab_tab1.ajax__tab_active.ajax__tab_outer {background:url("Images\green_gradient_4.gif")no-repeatright;}

.ajax__tab_tab1.ajax__tab_active.ajax__tab_inner {background:url("Images\green_gradient_3.gif")no-repeat;}

.ajax__tab_tab1.ajax__tab_active.ajax__tab_tab {background:url("Images\green_gradient_1.gif")repeat-x;}

.ajax__tab_tab1.ajax__tab_body {font-family:verdana,tahoma,helvetica;font-size:10pt;border:1pxsolid#999999;border-top:0;padding:8px;background-color:#ffffff;}

/* scrolling */

.ajax__scroll_horiz {overflow-x:scroll;}

.ajax__scroll_vert {overflow-y:scroll;}

.ajax__scroll_both {overflow:scroll}

.ajax__scroll_auto {overflow:auto}

thank you,

kkof

You should apply the CssClass attribute to the TabContainer control rather than to the TabPanel element.

Kind regards,

sbogus.


Thanks sbogus, placing the CssClass on the TabContainer corrected the issues I was having.

Saturday, March 24, 2012

TabContainer - No Designer Support?

Hello,

I wanted to work with controls in the tab container's panel, but it does not seem that the control has any designer support for me to be able to do that at all? Is that true, or am I missing something? Will there be designer support, because that makes it difficult to make changes to the page.

Thanks.

Hi Bmains,

I suspect your Ajax Control Toolkit is not the latest version. Please upgrade toV10618 orV10920.

Best regards,

Jonathan

TabContainer - Two Components with the same id error

Hi. I've loaded the most recent AJAX Controls Toolkit and am using a TabContainer and TabPanels. I try to run a report from Oracle by clicking on an image button elsewhere on the screen, which should (and does) cause the report to be generated. It then is to switch TabPanels and show the report. At that point, I get:

Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'TabContainer1_TabPanel1' can't be added to the application.

I've researched on the forums and found a few proposed fixes to this issue. Unfortunately, none of them seem to work. Has anyone seen this with the TabContainer, and is there a fix? If I set debug=false in the web.config it goes away, but I realize that isn't truly a solution.

Regards,

Mark

Hi Mark,

I am having similar problem. My case was, I have a user control that contains MultipleSelectorExtender from ajax control toolkit. On my page, I need to hide and show this user control on a specific event. The first time I set the Visible property of this user control that contains the MultipleSelectorExtender, I am not getting any error. The next time that I attempted to set the visible property of the usercontrol to true, I got the error message "Sys.InvalidOperationException: Two componnents with same id '<multipleselectorextender's Id>' can't be added to the application."

It seems that the component was recreated again when the container wast set to visible.

Have you found solution to your problem? If so, kindly post it here.

tia,

/randz

TabContainer and FormView

Hello,

I would like to replace our current tab solution with the tab controls found in the ajax control toolkit. I've spent a few days trying to get the tabs to operate in the manner I would like and was wondering if anyone could explain the best way to use TabContainer and FormView controls together.

Basically, I would like to do the following:
<asp:SqlDataSource ... /><asp:FormView ...><EditItemTemplate><ajaxToolkit:TabContainer ...><ajaxToolkit:TabPanel ID="Panel1" ...>...</ajaxToolkit:TabPanel><ajaxToolkit:TabPanel ID="Panel2" ...>...</ajaxToolkit:TabPanel></ajaxToolkit:TabContainer></EditItemTemplate></asp:FormView>

When I build pages based on this - Update and Insert commands fail with "You must declare the scalar variable XXX" errors as the formview cannot find the editing controls inside the TabContainer because it is an INamingContainer. I have tried using multiple FormView controls (one for each tab panel) in concert to update & insert records - however the amount of custom code required is unacceptable.

The solution I choose has to be very reusable as we have hundreds of different pages (like this) in production. At this point I am considering writing my own client side tab control as I would like to come up with a solution as quickly as possible and I've hit a number of dead ends.

Does the ajax control toolkit support using a FormView that contains a TabContainer (am I just missing something)? Are there any good workarounds? Are there plans to add this kind of support in the future?

Any answers or information will greatly help me make my decisions. Thanks in advance,
J. Shane Kunkle

jkunkle@dotnet.itags.org.vt.edu

Any input or advice is appreciated...

Hi Shane,

I think it's not that easy to make works perfectly in your situation now.

Can you try to add a public property on the TabContainer, and take it as a parameter?


I'm sorry - i'm not sure i understand your advice. Are you advising that I should create a class that inherits from TabContainer - what would the new property do?

Thanks again for the assistance,

Shane


Yes, or you can change the its original code since it's provided.

Wednesday, March 21, 2012

TabContainer and OnClientActiveTabChanged

Hi,
I have a tabcontainer with 3 tabs.
On the first tab, I make some javascript controls and I would like to block the access to the 2 other tabs.

So, I add a function to the OnClientActiveTabChanged.

Here's my little test function

function clientActiveTabChanged(sender, args)
{
if ($get('<%=myControl2Test.ClientID %>').value=="1"){
var tabs = $find('<%=TabContainer1.ClientID %>');
tabs.set_activeTabIndex(0);
}
}

Using this method, I stay on right panel, but I get a Stack Error

Any help.

Stan

Hi Stan92,

My understanding of your issue is that you have three TabPanels inside a TabContainer and the second and third TabPanel are forbidden to access. If I have misunderstood, please let me know.

Stan92:

function clientActiveTabChanged(sender, args)
{
if ($get('<%=myControl2Test.ClientID %>').value=="1"){
var tabs = $find('<%=TabContainer1.ClientID %>');
tabs.set_activeTabIndex(0);
}
}

Using this method, I stay on right panel, but I get a Stack Error

Because there is a infinite loop in your code. When click on the Tab, the clientActiveTabChanged will be called and then tabs.set_activeTabIndex(0) will be excuted, now another OnClientActiveTabChanged will be fired. You can add "alert(1);" inside the clientActiveTabChanged(sender, args) function and have a test that will be make you clear.

So my solution is adding an additional condition to the function. Sentence tabs.set_activeTabIndex(0) will be execute only in the case of activeTabIndex is not zero. Here is the whole sample

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" AutoPostBack="false" OnClientActiveTabChanged="changeTab" ActiveTabIndex="1"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server"> <HeaderTemplate>Tab1</HeaderTemplate> <ContentTemplate> <div id ="myDiv"><%=DateTime.Now.ToString()%></div> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel2" runat="server"> <HeaderTemplate>Tab2</HeaderTemplate> <ContentTemplate>Wonderful</ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> <script type="text/javascript" language="javascript"> function changeTab(){ if($find("<%=TabContainer1.ClientID%>").get_activeTabIndex()!=0) $find("<%=TabContainer1.ClientID%>").set_activeTabIndex(0); } </script> </form></body></html>
I hope this help.
Best regards,
Jonathan

TabContainer Lag when loading controls by __doPostBack in OnClientActiveTabChanged

I am using a tabContainer on my web. My final product is a TabContainer nested inside of another TabContainer, but the latency is static between the two scenarios.
Here is a sample of my code:

 
 <script type="text/javascript"> function ActiveTabChanged2(sender, e) { __doPostBack(sender.get_id(), sender.get_activeTab().get_headerText()); } </script>

Container =new TabContainer(); Container.ID ="Container"; Container.OnClientActiveTabChanged ="ActiveTabChanged2"; Container.ActiveTabChanged +=new EventHandler(ActiveTabChangedServer); Container.CssClass ="ajax__tab_gray";public void ActiveTabChangedServer(object sender, EventArgs e) {string ID =""; TabContainer tab = (TabContainer)TabContainer1.ActiveTab.FindControl("Container"); TabContainer BottomTab = (TabContainer)tab.ActiveTab.FindControl("Container2"); ID = BottomTab.ActiveTab.ID.Substring(4); UpdatePanel Upd = (UpdatePanel)BottomTab.ActiveTab.FindControl("upTab_List"); Upd.ContentTemplateContainer.Controls.Add(new LiteralControl("test")); }

Now, everything functions properly with my scriptmanager catching the postback and rerouting it to an async, etc.

The problem is, there is 2 seconds where the server and client is doing absolutely nothing before it will write "test" in my updatepanel.

No matter what scenario I use, everything loads fine, the async postback is rerouted, but then after that there is 2 seconds of nothing before the text is written, as if I were to do a thread.sleep

any help would be much appreciated as this is a main part of my corporate intranet site and I would love to keep ajax as a part of that site, but 2 seconds on top of every loadtime is leading people to beleive the resource is broken as they click from tab to tab quickly with a blank page underneath each.

Thanks,

Brandon Schoen
Netlist
Sr. .Net Architect
www.netlistinc.com

0 replies... does this mean I am the only person to experience this issue?