Showing posts with label aspnet. Show all posts
Showing posts with label aspnet. 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.UpdatePanel does not have a public property named UpdatePanelAnimationExtend

'System.Web.UI.UpdatePanel' does not have a public property named 'UpdatePanelAnimationExtender'.

I have nothing but problems with ASP.Net AJAX. Could somebody tell me what is going on?

Newbie

The updatepanel doesn't have a public property named that - you have to use the AjaxToolkit to get that animation feature...

http://www.codeplex.com/AtlasControlToolkit

and from the sample website this is the code:

<%@.Page

Language="C#"

MasterPageFile="~/DefaultMaster.master"

AutoEventWireup="true"

CodeFile="UpdatePanelAnimation.aspx.cs"

Inherits="UpdatePanelAnimation_UpdatePanelAnimation"

Title="UpdatePanelAnimation Sample" %>

<%@.Register

Assembly="AjaxControlToolkit"

Namespace="AjaxControlToolkit"

TagPrefix="ajaxToolkit" %>

<asp:ContentContentPlaceHolderID="SampleContent"Runat="Server">

<asp:ScriptManagerrunat="server"EnablePartialRendering="true"/>

<divclass="demoarea">

<divclass="demoheading">UpdatePanelAnimation Demonstration</div>

<divstyle="margin-bottom: 10px;">

<divstyle="border: dashed 1px #222222;">

<divid="up_container"style="background-color: #40669A;">

<asp:UpdatePanelID="update"runat="server">

<ContentTemplate>

<divid="background"style="text-align: center; vertical-align: middle; line-height: 44px; padding: 12px; height: 44px; color: #FFFFFF;">

<asp:LabelID="lblUpdate"runat="server"Style="padding: 5px; font-size: 14px; font-weight: bold;">

4/28/1906 12:00:00 AM

</asp:Label>

</div>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlID="btnUpdate"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

</div>

</div>

</div>

Choose the effects, then press 'Update':<br/>

<inputtype="checkbox"id="effect_fade"checked="checked"/><labelfor="effect_fade">Fade</label><br/>

<inputtype="checkbox"id="effect_collapse"checked="checked"/><labelfor="effect_collapse">Collapse</label><br/>

<inputtype="checkbox"id="effect_color"checked="checked"/><labelfor="effect_color">Color Background</label><br/>

<asp:ButtonID="btnUpdate"runat="server"Text="Update"OnClick="btnUpdate_Click"/>

<ajaxToolkit:UpdatePanelAnimationExtenderID="upae"BehaviorID="animation"runat="server"TargetControlID="update">

<Animations>

<OnUpdating>

<Sequence>

<%-- Store the original height of the panel --%>

<ScriptActionScript="var b = $find('animation'); b._originalHeight = b._element.offsetHeight;"/>

<%-- Disable all the controls --%>

<Parallelduration="0">

<EnableActionAnimationTarget="ctl00_SampleContent_btnUpdate"Enabled="false"/>

<EnableActionAnimationTarget="effect_color"Enabled="false"/>

<EnableActionAnimationTarget="effect_collapse"Enabled="false"/>

<EnableActionAnimationTarget="effect_fade"Enabled="false"/>

</Parallel>

<StyleActionAttribute="overflow"Value="hidden"/>

<%-- Do each of the selected effects --%>

<Parallelduration=".25"Fps="30">

<ConditionConditionScript="$get('effect_fade').checked">

<FadeOutAnimationTarget="up_container"minimumOpacity=".2"/>

</Condition>

<ConditionConditionScript="$get('effect_collapse').checked">

<ResizeHeight="0"/>

</Condition>

<ConditionConditionScript="$get('effect_color').checked">

<ColorAnimationTarget="up_container"PropertyKey="backgroundColor"

EndValue="#FF0000"StartValue="#40669A"/>

</Condition>

</Parallel>

</Sequence>

</OnUpdating>

<OnUpdated>

<Sequence>

<%-- Do each of the selected effects --%>

<Parallelduration=".25"Fps="30">

<ConditionConditionScript="$get('effect_fade').checked">

<FadeInAnimationTarget="up_container"minimumOpacity=".2"/>

</Condition>

<ConditionConditionScript="$get('effect_collapse').checked">

<%-- Get the stored height --%>

<ResizeHeightScript="$find('animation')._originalHeight"/>

</Condition>

<ConditionConditionScript="$get('effect_color').checked">

<ColorAnimationTarget="up_container"PropertyKey="backgroundColor"

StartValue="#FF0000"EndValue="#40669A"/>

</Condition>

</Parallel>

<%-- Enable all the controls --%>

<Parallelduration="0">

<EnableActionAnimationTarget="effect_fade"Enabled="true"/>

<EnableActionAnimationTarget="effect_collapse"Enabled="true"/>

<EnableActionAnimationTarget="effect_color"Enabled="true"/>

<EnableActionAnimationTarget="ctl00_SampleContent_btnUpdate"Enabled="true"/>

</Parallel>

</Sequence>

</OnUpdated>

</Animations>

</ajaxToolkit:UpdatePanelAnimationExtender>

</div>

<divclass="demobottom"></div>

System.Web.UI.UpdatePanel does not have a public property named Login

I am trying to wrap an updatepanel in a login wizard and it is giving me the error described in the subject.

Am I doing something incorrectly.

From other posts that I have read this is possible.

Does anyone have an ideas.

It would be greatly appreciated.

it must be inside of<ContentTemplate>from theUpdatePanel, did you checked that?
Thanks for the information

Try this

<asp:UpdatePanel ID="UpdatePanel 1" UpdateMode="Conditional" runat="server">
<ContentTemplate>

<asp:Login ID="Login1" runat="server" ></asp:Login>

</ContentTemplate>
</asp:UpdatePanel>

System.Web.UI.Timer interval in client side code

Has anyone successfully set the Interval property in a System.Web.UI.Timer control using client side scripting of any language?

var timer = $find('<%= Timer1.ClientID %>');
timer.set_interval(5000);

FYI, some other methods are:

timer.get_interval();
timer._startTimer();
timer._stopTimer();
timer.set_enabled(true/false);


If this works I owe you a pretend steak dinner. Spent all day yesterday trying to track this down.


Big Smile Let me know if it does. I like my pretend steaks done pretend medium.


Okay so at first it didn't work. So I started experimenting.

It works when there's no master page, and just one single page, and the script is inside the page, call this TestSingle.aspx.

So I moved it to the child page, the timer resides on the child page, and put the script inside the child page and it works, call this Child.aspx.

So then I moved the script to the outside file that is loaded by the master page into every page and the function fails to find Timer1.

So then I used TestSingle.aspx again, and this time loaded the function from an outside .js file, and it failed to find Timer1.

Long story short, it works, but if it's trying to access Timer1 via script in an outside file, it fails to find Timer1. Is there some qualifier I need now?


Can you post the contents of your .js file as well as the source code where you reference it in the master page?


The only thing I put in the .js file was:

function StopTimer()
{
alert(1);
var timer = $find('<%= Timer1.ClientID %>');
alert(timer);
//timer.set_interval(5000);
alert(timer.get_interval());
//timer._stopTimer();

}

<%@. Page Language="C#" AutoEventWireup="true" CodeBehind="TestSingle.aspx.cs" Inherits="Website.TestSingle" %><!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>Untitled Page</title><script src="./script/Test.js" type="text/javascript"></script> </head><body> <form id="form1" runat="server"> <div>   <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:Timer ID="Timer1" runat="server"> </asp:Timer> <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="StopTimer()" /> </form></body></html>

That setup fails to find Timer1, not even using a master child setup.


Take out the <script src="./script/Test.js" type="text/javascript"></script> and reference it via your script manager control.

<asp:ScriptManagerID="ScriptManager1"runat="server">
<Scripts>
<asp:ScriptReferencePath="./script/Test.js"/>
</Scripts>
</asp:ScriptManager>


Nope didnt work.


Sorry I didn't catch it the first time around...

In the .js file you can't use the <%= %> notation. That is strictly an ASP.NET thing. The only thing that can be in the .js file is pure javascript. So you want it to look like:

var timer = $find('Timer1');

$find() does take a second, optional parameter that allows you to specify the parent of the component you're looking for. That basically serves the same purpose as requiring it to use the ClientID of the control. You can read more about that here: http://www.asp.net/AJAX/Documentation/Live/ClientReference/Sys/ApplicationClass/SysApplicationFindComponentMethod.aspx


You can't use inline server script in your JavaScript include files. So, $find('<%= Timer1.ClientID %>') is literally looking for a control with the client ID of<%= Timer1.ClientID %>.

I'd set a JavaScript variable in pageLoad() with the Timer's ClientID and then reference that in the included script.


So how does one access the Client ID from javascript? <% ClientID %> ?


OnClientClick="StopTimer(<%= Timer1.ClientID %>)"

function StopTimer(args) {
var timer = $find(args);
timer.set_interval(5000);
}


Well yeah that achieves stopping it with a button. But in actuality what I'm going to do is "onfocus" on a TextBox/ComboBox/Etc. call StopTimer, and on a onblur turn it back on. This naturally has to happen within a millisecond, and be extremely easy to code into the project. ie StopTimer and StartTimer exists in a separate file and I just past "onfocus=StopTimer() onblue=StartTimer()" into the <input>'s, or in the pageload set attributes for windows controls.

So yeah, I could put that function you wrote in the outside .js file and just have the function take a parameter. But that's gonna make the HTML even bigger then it is already, although that should work.

And every child has TimerTicker added to it programmatically from the inherited root class every child page inherited. That way I dont have to manually add it to every child page someone makes, this solution is already at 30 child pages based off same master.


Yeah it's not finding hte control even with the args method you posted. It's acutally erroring out and giving syntax error. Adding ' ' to either side on StopTimer('<%= Timer1.ClientID %>') just sends the string to the method.

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

System.Web.UI.WebControls.Menu and UpdatePanels / WebParts

Hi,

(using April version of Atlas)
I have a web form with a script manager, a web part manager, a menu and a web part zone with a generic web part in it. An update panel is around the web part manager and the web part zone. When I click on the arrow for the popup web part menu and chose for example "minimize", everything works fine for the first time, until the web part is rendered: When I want to click once again on the arrow for the popup web part menu, nothing happens anymore (nothing = no popup of the menu). This is just because of the System.Web.UI.WebControls.Menu on the page. When I remove the System.Web.UI.WebControls.Menu, everything works normal.

I made a sample code, to reproduce the problem:

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb"Inherits="_Default" %><!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 runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/> <div> <atlas:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:WebPartManager ID="WebPartManager1" runat="server"> </asp:WebPartManager> </ContentTemplate> </atlas:UpdatePanel> <br /> <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal"> <Items> <asp:MenuItem Text="Neues Element" Value="Neues Element"> <asp:MenuItem Text="Neues Element" Value="Neues Element"> <asp:MenuItem Text="Neues Element" Value="Neues Element"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Neues Element" Value="Neues Element"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Neues Element" Value="Neues Element"> <asp:MenuItem Text="Neues Element" Value="Neues Element"></asp:MenuItem> </asp:MenuItem> </Items> </asp:Menu> <br />  </div> <atlas:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> <asp:WebPartZone ID="WebPartZone1" runat="server"> <ZoneTemplate> <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar> </ZoneTemplate> </asp:WebPartZone> </ContentTemplate> </atlas:UpdatePanel> </form> </body></html>

ASH123,

I am having the same issue. I found that if you set WebPartVerbRenderMode to TitleBar, you are allowed to minimize/restore the webpart multiple times.

Did you ever find a solution that doesn't involve this work around?

Thanks

system.webServer and sys is undefined

Hi,

I know this has been on the table before but I've been struggling with "sys is undefined" when running in IIS7 Integrated mode for a while now and it would be great to get a good answer from MS (or someone else) about this. Classic mode works just fine. There are 5000 different "solutions" available in the forums and the only thing I've managed to get to work is removing the <handlers> section under <system.webServer>. The application still works as expected. Aren't these lines required? They already exist in <httpHandlers> below <system.web>.

When I accesshttp://localhost/test/ScriptResource.axd with the <handlers> still there I get:

Description: Handler "ScriptResource" has a bad module "ManagedPipelineHandler" in its module list
Error Code: 0x8007000d
Notification: ExecuteRequestHandler
Module: IIS Web Core
Requested URL:http://localhost:80/test/ScriptResource.axd
Physical Path: C:\Projects\test\web\ScriptResource.axd
Logon User: domain\user
Logon Method: Negotiate
Handler: ScriptResource

When I remove the section the application works but I get 404 instead when accessinghttp://localhost/test/ScriptResource.axd.

Can someone please explain or point me in the right direction?

Many thanks,
Manso

Hi,

Please refer to this thread:http://forums.asp.net/p/1048901/1504197.aspx#1504197

Hope this helps.

System.WebForms.PageRequestManagerParserErrorException The message revieved from the serve

I am trying to use update panel's feature to asyncronously postback and update the data in one of my grid. I am using Master Page and ASPX and a User Control that actually contains the button, Update Panels and a Grid.

When I click btnRefresh I get the following error:

System.WebForms.PageRequestManagerParserErrorException The message revieved from the server could not be parsed...

My ascx looks like this:

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

<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="Conditional">
<ContentTemplate>
<asp:ImageButtonID="btnRefresh"runat="server"ImageUrl="~/refresh.gif"OnClick="ImageButton1_Click"/>
</ContentTemplate>
</asp:UpdatePanel>

<asp:UpdatePanelID="UpdatePanel2"runat="server">
<Triggers>
<asp:AsyncPostBackTriggerControlID="btnRefresh"/>
</Triggers>
<ContentTemplate>
<igtbl:UltraWebGridID="UltraWebGrid1"runat="server"Height="200px"Width="468px"style="left: 1px; top: 226px">
</igtbl:UltraWebGrid>
</ContentTemplate>
</asp:UpdatePanel>

Could someone please suggest on this? Is the problem with User Controls??

Guys,

I added the script manager in my Master Page and then added scriptManagerProxy at my user controls which resolved the problem.

Cheers,

Ashish

Sytem.Drawing.ToolboxBitmapAttribute

I have a simple page that uses the UpdatePanel and runs fine locally, but when uploaded to a Windows 2003 server with .NET 2.0 and AJAX Extensions 1.0 installed I get the following error:

"The type initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception."

As far as I understand it, that part of the framework is for Windows Forms. This is an ASP.NET website. Any ideas?

Ashiki:

"The type initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception."

As far as I understand it, that part of the framework is for Windows Forms. This is an ASP.NET website. Any ideas?

The ToolboxBitmapAttribute is used for all ServerControls with an UI to show an icon in the VS ToolBox. Maybe it helps to register the System.Web.Extensions.Design.dll in the web.config on youre Server because the UpdatePanel has a reverence in his Attributes to the resources in this assembly. Reflector shows the classdeffinition as follows.

[

Designer("System.Web.UI.Design.UpdatePanelDesigner, System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"),ToolboxBitmap(typeof(EmbeddedResourceFinder),"System.Web.Resources.UpdatePanel.bmp"),DefaultProperty("Triggers"),ParseChildren(true),PersistChildren(false),AspNetHostingPermission(SecurityAction.LinkDemand,Level=AspNetHostingPermissionLevel.Minimal),AspNetHostingPermission(SecurityAction.InheritanceDemand,Level=AspNetHostingPermissionLevel.Minimal)]

Hope that helps


I see - the web.config automatically generated by VS for an AJAX site has this already in the web.config:

<

assemblies>

<

addassembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</

assemblies>

I'd never noticed that before, and I guess its there for the reason you give. I've tried adding a reference for System.Web.Extensions.Design as well, just in case, but I still get the same error on the server.


In youre first posting you write: "Thetype initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception"!

If it possible, debug the App on the Server to see where exactly the Exception is thrown.

I think the Exception is thrown on this point:ToolboxBitmap(typeof(EmbeddedResourceFinder),

If so, you see more Information in the stack.

Hope that helps.


I can run the website from VS installed on the server and there are no errors at all - it runs fine. When I access the site externally from a browser though I still get the error. Is it a permissions thing?

Well, after many trial and error attempts at a fix I finally uninstalled AJAX Extensions, installed SP2 for Windows 2003, deleted the website from IIS, re-installed AJAX, recreated the website and now its all running OK.


Hello, I have the same error since 2 days on my server. I have a dropdown list .

http://www.laposturologie.com/testbug.aspx

Pleaaaaaase help


I never found out what that error message means, but once I had done the uninstall and re-install as in my post above I've never seen the error again.


godaddy don't want to help me about that error

they told me it is in my code...there's nothing wrong in my code because i have changed nothing and then this error came up.

u can see the page :

http://www.carteinter.com/testbug.aspx

this error happens only when there is a gridview and an sql datasource

u can see the working page

http://www.carteinter.com/testbug.aspx


mistake in last post

the working page is

http://www.carteinter.com/Main.aspx

the page not working is

http://www.carteinter.com/testbug.aspx


I'm having this problem as well. It's only on the host and it happens with both a GridView and a DataList. I'm using an ObjectDataSource instead of a SQLDataSource, but it seems like it's the GridView (not the data source) that's causing the grief. I've removed everything else that could be causing this problem. I just have a class with a static method that gets some rows from the DB and puts them in a DataSet. I've set this as the SelectMethod for my ObjectDataSource and bound the GridView to the ObjectDataSource.

I get the parser error with this simple page (2 controls, nothing else).

Unfortunately, like others have mentioned - since I am on a host (GoDaddy) I can't just reinstall, reboot, delete temporary IIS files, or reset IIS. I did change things several times so the app got recycled, but I've continued to have problems.

Its pretty clear something to do with the server control is not functioning properly and it would be nice to get a little help from someone at Microsoft. Those of us on external hosts are pretty much stuck here. I can rewrite the code to display all this by hand (using codebehind) but that will take a lot of work.


CHANGE HOST ASAP!!!!!!!!!!!

GODADDY REALLY SUCKS !!

THEY CAN'T FIX A BUG, THERE ARE POOR IN TECHNICAL SUPPORT, THERE ARE SURELY A LOT OF USERS THAT HAVING THIS PROBLEM

IM NOT THE ONLY ONE AS U CAN SEE...

I HAVE CHANGED HOST AND NOW MY WEB SITE WORKS FINE

U CAN TAKE A LOOK :

WWW.CARTEINTER.COM

tab

how can i use tab control that is NEW on AjaxWEBsite Sample?

Maybe...look at the sample web site page which shows you how to use it!

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 Back Color

Anyone having problems setting the back color on a tab? The tab remains white no matter what.Yes i have the same problem. I cannot change the back color. I've tried to create my own CSSClass but when i'm trying to link my tab contol on my cssclass it doesn't work at all.

tab and IE 7

I am a bit miffed. I am trying to get the ajax tab control to work and I am running into some issues with IE7. The style doesn't show up in IE7 if I access the page from my web server. The style shows up just fine using Firefox if I access the page from the web server. The style shows up if I access the page using the web server with Visual Studio. Why does the same page work locally and not from a production web server? All I can see in IE7 from the production web server is the tab headers which still work if I click on them.After further testing I discoverd that the ajax tab control only works if it's in the root directory for the site on the production server.

I m having problem to get right view in IE 7, while on firefox it runs fine.

I want to apply ajax tab control not on root directory but inside folder can anyone help me.

Tab container - Progressive enhancement

I am new to AJAX and the control toolkit.

I read about "Graceful degradation/Progressive enhancement" on another site and I am wondering how I can code for it when I use a tab container. I was testing with the AJAX tab container/tab panel but when I disable javascript in the browser, the page with the tab is blank. On some sites using tabs, the result of turning javascript off is different. The page shows atleast the first tab's information but nothing happens when the second tab is selected.

I realize I can add a message - "this site needs javascript to be turned on" or redirect the user to another page if javascript is disabled. I am wondering if there is anything else I can do so the page does not show up blank.

Thanks!

Hi,

May be you can try this.

Add a pure text-based header, set its visibility to hidden via javascript on load.

So that it will be visible if the javascript is disabled.

Hope this helps.


The Toolkit is not supported to work if javascript is turned off. The behavior may not be tuned to gracefully degrade and it is not a scenario we plan to solve since the Toolkit controls all operate in client side ASP.NET AJAX behaviors which need javascript to be turned on and it may be hard to do the same. If you are using the Toolkit on sites which may be expected to work when javascript is turned off then it may need to be taken care of in your code.

Tab container

hi all,

i have placed the tab container in side a datagrid. tab container will appear in the item command of datagrid. if i set the active tab index as zero. i got some error.

57 line 17 char

argument out of range exception

1495 line 38 char

this.get_element().style is null or not an object.

if i remove that active tab index property tab container works fine.

how to close the tab container?

please help me

Balaji

Hi Balaji,

Can you show me your relevant code so that I can reproduce your issue?
A stripped simpler version of your code would be better.

Looking forward to your reply.

hi,

here is my code snippet

protectedvoid dlHostels_ItemCommand(object source,DataGridCommandEventArgs e)

{

tabcontainer tbc=new tabcontainer();

tbc = (TabContainer)dlHostels.Items[e.Item.ItemIndex].FindControl("TabContainer1");

Label lblInfo =newLabel();

TabPanel tp = new tabpanel();

tp.controls.add(lblinfo);

tbc.controls.add(tp);

//i have added three panels to this tabcontainer.

tbc.activetab=0; // problem with this tabindex. if i didnt mention anything then it works fine.

}

tab container

hai

i had a tabcontainer.i want to do some server side events when tab index changed.but when i change the tabindex the tab container disappears.how to solve this.i am using ie 6 and asp.net 2.0.i had set the autopost back property of tabcontainer to true.

please sort this issue out.

thanks in advance.

regards

mugil

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

-Damien


Hi Mugil,

Has your problem been resolved yet? If yes, would you please mark it as "answered". Otherwise, please provide your simple sample which contains your issue. Generally, your problem is not occurred in your scene so we really need your code.

Best regards,

Jonathan


Hi Mugil,

Here is an sample. Please compare it with yours.

<%@. 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 TabContainer1_ActiveTabChanged(object sender, EventArgs e)
{

}
</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="true" OnActiveTabChanged="TabContainer1_ActiveTabChanged">
<ajaxToolkit:TabPanel ID="TabPanel1" runat="server">
<HeaderTemplate>
Tab1</HeaderTemplate>
<ContentTemplate>
<asp:Panel ID="Panel1" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</asp:Panel>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel2" runat="server" >
<HeaderTemplate>
Tab2</HeaderTemplate>
<ContentTemplate>
<asp:Panel ID="Panel2" runat="server" Height="200" Width="100%" style="overflow:auto">
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</asp:Panel>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</form>
</body>
</html>
If it doesn't work, please check your system environments. We suggest that you should upgrade your Ajax Control Toolkit to the latest version. (10618 or 10920).

Hope this helps.

Best regards,

Jonathan.

Tab Container

I have seen the tab container inside an update panel and with out any update panels.

Which is correct?

Thank!

Dennis4j,

The only reason I put the TabContainer inside of an UpdatePanel is when I have an "editable" GridView inside one of the tabs. I can't remember where I read this, but in order for the tab control to keep track of the correct tab when the grid goes into edit mode this had to be done. I think it was logged as a bug but I don't have the details handy.

Regards.

Tab Container Custom Style in Firefox...

Hi,

I am using a TabContainer with a custom CSS file. I have copied the original CSS file and have modified it a little. Here is the CSS I am using:

/* xp theme */

/* Our Additions */

.StpAjaxTab

{

margin-left:auto;margin-right:auto;

}

.StpAjaxTab.ajax__tab_header

{

font-family:verdana,tahoma,helvetica;font-size:11px;

/* Our Additions */

border-bottom:solid1px#000000;text-align:left;

}

.StpAjaxTab.ajax__tab_outer

{

padding-right:4px;height:21px;

}

.StpAjaxTab.ajax__tab_inner

{

padding-left:3px;

/* Our Additions */

border:solid1px#000000;

}

.StpAjaxTab.ajax__tab_tab

{

height:13px;

padding:4px;

margin:0;

}

.StpAjaxTab.ajax__tab_hover.ajax__tab_outer

{

}

.StpAjaxTab.ajax__tab_hover.ajax__tab_inner

{

/* Our Additions */background-color:#DDDDDD;

}

.StpAjaxTab.ajax__tab_hover.ajax__tab_tab

{

/* Our Additions */background-color:#DDDDDD;

}

.StpAjaxTab.ajax__tab_active.ajax__tab_outer

{

}

.StpAjaxTab.ajax__tab_active.ajax__tab_inner

{

/* Our Additions */

background-color:#DDDDDD;

border:solid1px#000000;

}

.StpAjaxTab.ajax__tab_active.ajax__tab_tab

{

/* Our Additions */background-color:#DDDDDD;

}

.StpAjaxTab.ajax__tab_body

{

font-family:verdana,tahoma,helvetica;

font-size:10pt;

border:1pxsolid#999999;

border-top:0;

padding:8px;

background-color:#ffffff;

/* Our Additions */

background-color:#DDDDDD;

border:solid1px#000000;border-top:none0px;

}

I am using the TabContainer with the CssClass like this

<asp:UpdatePanelID="UpdatePanel1"runat="server">

<ContentTemplate>

<ajax:TabContainerID="TabContainer"runat="server"Width="750px"Height="200px"meta:resourcekey="TabContainer"CssClass="StpAjaxTab">

<ajax:TabPanelID="AlleTrefferTabPanel"runat="server">

<HeaderTemplate>

<asp:UpdateProgressID="UpdateProgress"runat="server">

<ProgressTemplate>

<asp:ImageID="ProgressImage"runat="server"ImageUrl="~/Images/progressIcon.gif"Width="16"Height="16"/>

</ProgressTemplate>

</asp:UpdateProgress>

<asp:LabelID="AlleTrefferLabel"runat="server"Visible="false"Text="Alle Treffer"meta:resourcekey="AlleTrefferLabel"></asp:Label>

</HeaderTemplate>

<ContentTemplate>

Content, you may place a button to generate a partial postback...

</ContentTemplate>

</ajax:TabPanel>

</ajax:TabContainer>

 

</ContentTemplate>

</asp:UpdatePanel>
If you try this out, you will see, that it will see that it works perfectly on IE. But on firefox, when a partial postback is generated, the tab headers' positions are not as they have to be.
After a partial postback has been generated, the tabs are not moving back to their original position. So the question is simple. How can I get the TabContainer in firefox behave exact like in IE?
I tried to change the css styles, but it doesn't worked.
Thanks for help,
bye...

Seehttp://blogs.visoftinc.com/archive/2007/09/26/ajax-control-toolkit-tab-control-themes.aspx for a tab theming example.

-Damien

Tab container bug

Hi,

while changing the backcolor of tabcontainer, this one (the tabcontainer) has blast all the page code away:

Line 16: "TabPanel1" runat="server">Line 17: "server">Companii"281479271677955" href="" onclick="return;">Line 18: "server">Line 19: "server" ID="UpdatePanel1" __designer:dtid="281479271677957">"281479271677958">

I checked twice this error and happens only after adding tab panels.

Is a tab container or is something wrong with my application? Or is because of the update panel situated inside of a tab panel ?

Getting the same issue when changing the properties of the tabcontainer in a design mode...


Same problem here!!!!

Everytime I set the width of the TabContainer in design view, every<ContentTemplate>gets replaced with <system.web.ui.control>IndifferentIndifferentIndifferentIndifferentIndifferent

tab container and tab panels

I'm getting what I think is odd behavior from the tab panels. Everything of course works fine if the tab panels are static. However, I want to programmatically add to the tab container in my code behind.

The first time the page loads the outline of the tab container is present (which is fine). I click a button and do a postback for the update panel and two tabpanels are added to the tabcontainer. If I do another postback, then I get an error "There is no source code available for the current location." message box. I click OK. I then get a message box that says, "ArgumentOutOfRangeException was unhandled by user code ....Specified argument was out of range of valid values...Parameter name: index".

For example,

"UpdatePanel1" runat="server" UpdateMode="Conditional"> "TabContainer1" runat="server"> "HiddenField1" runat="server" OnValueChanged="HandleNodeClick"/>public void HandleNodeClick(Object sender, EventArgs e){ AjaxControlToolkit.TabPanel panel1 =new AjaxControlToolkit.TabPanel(); panel1.HeaderText ="panel1"; panel1.Visible =true; panel1.ID ="panel1"; AjaxControlToolkit.TabPanel panel2=new AjaxControlToolkit.TabPanel(); panel2.HeaderText ="panel2"; panel2.Visible =true; panel2.ID ="panel2"; TabContainer1.Controls.Add(panel1); TabContainer1.Controls.Add(panel2);}
As a workaround I tried the following, which didn't work either. I have three different formats of tabcontainers I want to use. I tried just putting the three different tabcontainers on the aspx page to begin with. In the code behind, on page load I set .visible=false for all 3 (which worked as expected). Based on an event, I then set .visible=true for a given tabcontainer. However, only the text of the desired tabcontainer is displayed -- the formatting, the panels, etc. aren't. Suggestions for either of these approaches is much appreciated.

In my case I have successfully created the tabs and the buttons on them - they display just fine and the tabs select. However, as soon as I click on any of the buttons the same error arises. Setting an eventhandler for each button does not cure the problem.

I am very keen for a quick solution!


Further investigation shows that the problem does not even relate to adding controls to the tab but arising even if adding tabs dynamically.

I added a button outside the tab and then just did the tab adding.:

Dim FC()As cCategory = cCategory.AllCats
Dim iAsInteger
For i = 0 To FC.length-1
Dim tab As New AjaxControlToolkit.TabPanel
tab.HeaderText = FC(i).TabName
tab.ID = "tab" & CStr(i)
tbForms.Tabs.Add(tab)
NexttbForms.ActiveTabIndex = 0

A click on the static button then produces the error message.

It seems as if the wiring up of the postback info is incomplete with the dynamically created tabs.


OK guys - I found most of the answer from another thread - use Page_Init

However . . .

ProtectedSub Page_Init(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.InitDim FC()As cCategory = cCategory.AllCats
Dim iAsInteger
For i = 0To 0
Dim tabAsNew AjaxControlToolkit.TabPanel
tab.HeaderText = FC(i).TabName
tab.ID ="tab" &CStr(i)
Dim FM()As cForm = cForm.Tab(FC(i).TabId)
Dim FMname(FM.Length - 1)AsString
Dim jAsInteger
For j = 0To 0
Dim btnAsNew Button
btn.Text = FM(j).Description
btn.ID ="btn" &CStr(i) &":" &CStr(j)
AddHandler btn.Click,AddressOf ButtonClick
tab.Controls.Add(btn)
FMname(j) = FM(j).Description
Next
tbForms.Tabs.Add(tab)
Next
EndSub

PublicSub ButtonClick(ByVal senderAsObject,ByVal eAs System.EventArgs)
EndSub

This fires a postback OK but this never reaches the ButtonClick routine.

Why?


Making progress very slowly!

The Page_Init is performed every time a postback occurs (Before Page_Load) and at that time the dynamically added control do not exist (they have to be re-created each time around, it seems) If I test for postback at the start of Page_Init and do not do the dynamic creation at that time, then the same error as before occurs.

I do not fully understand what is going on but I guess that the postback cannot connect up with the event handling which was created the first time around. Presumably I need to find some way of working out what the postback actually is and look at it explicitly.

Any ideas, folks?


I think I'm hitting the same issue.

I've added two tab panels to my TabContainer statically. The tab panels host the ReportViewer control which is possibly a bit ambitious but it is a business requirement if possible.

Then in the Page_Load event handler I add a third tab panel dynamically with the following code block :

ReportViewer rv = new ReportViewer();
rv.ID = "rv3";
rv.ProcessingMode = ProcessingMode.Remote;
rv.Height = 500;
rv.Width = 950;
rv.Reset();
SetReportParameters(rv, 53); // this just inits the reportviewer

AjaxControlToolkit.TabPanel tabPanel = new AjaxControlToolkit.TabPanel();
tabPanel.ID = "tab3";
tabPanel.HeaderText = "Dynamically added tab panel";
tabPanel.Controls.Add(new LiteralControl("<ContentTemplate>"));
tabPanel.Controls.Add(rv);
tabPanel.Controls.Add(new LiteralControl("</ContentTemplate>"));
//this.tabReports.Controls.Add(tabPanel);
this.tabReports.Controls.AddAt(tabReports.Controls.Count, tabPanel);

This all works fine but it's not really dynamic yet. So I then add a button to the page outside of the TabContainer and in the event handler for it I use a similar code block to the above except I use a different TabPanel.ID. This is when I run into the problem. Before the button event handler code is entered I'm getting the ArgumentOutOfRangeException and VS dumps me into the TabPanelCollection.cs class in the TabPanel method.

public new TabPanel this[int index]
{
get { return (TabPanel)base[index]; }
}

In my case index=2 and the Exception tells me the it is out of range of valid values. What is confusing me is that my code to insert the new panel hasn't been run yet so something else must be going on. In order to speed up diagnostics on this I'm going to remove the ReportViewers and put in some simple controls but in the meantime it would be good if someone from the AJAX team could comment on this issue.

I've now got wroking code - but at the price of a fudge!

Firstly, the dynamic creation must be done in Page_Init (not Page_Load) and must be done on every Postback, not just frst time through.

Secondly, in Page_Load on Postback, I check the Page.Request.Form collection. Despite all that I have read, there is nothing in the first few entries but (4) there is the full name of the control and its text value.

Dim sAsString = Page.Request.Form.AllKeys(4)
If s.ToLower.StartsWith("tbforms")Then
Dim s1()AsString = s.Split("$")
Dim s2AsString = s1(1).Substring(3)
Dim s3AsString = s1(2).Substring(3)
Dim tabNoAsInteger =CInt(s2)
Dim btnNoAsInteger =CInt(s3)

I am far from happy with this as it depends on an undpecified magic number (which, as we all know, chnages just when you can least afford it!)

I still suspect that there is a bug lurking somewhere here.