Wednesday, March 21, 2012

TabContainer Causes An Error When Rendering

I have been using theTabContainer for the past several months and like the way it works. After upgrading to the most recent version of the toolkit I now get an error when rendering any page that has a TabContainer. I updated the DLL's in my bin folder. The toolkit sample website works ok.

I tested with a page that has no other TabContainers, just the segment shown below and continue to get the error.

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

<ajaxToolkit:TabPanelID="TabPanel1"runat="server">

<ContentTemplate>

</ContentTemplate>

</ajaxToolkit:TabPanel>

</ajaxToolkit:TabContainer>

Is ther something I need to do to the web.config file 0r is there some other issue?

Error...

{"The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."}

The error occures in ScriptObjectBuilder at the hightlighted line shown below...

public

staticvoid RegisterCssReferences(Control control)
{
foreach (string styleSheetin ScriptObjectBuilder.GetCssReferences(control))
{
// Add the link to the page header instead of inside the body which is not xhtml compliant
HtmlLink link =new HtmlLink();
link.Href = styleSheet;
link.Attributes.Add("type","text/css");
link.Attributes.Add("rel","stylesheet");
control.Page.Header.Controls.Add(link);
}
}

This has been resolved... please follow this link for the answer...

http://forums.asp.net/thread/1617139.aspx


I have a Web Application where I want to use a TabContainer but when I load page it the control it is not loaded.
I should carry out a postbak in it page it and it is loaded somebody knows like I can solve it.

No comments:

Post a Comment