Showing posts with label produce. Show all posts
Showing posts with label produce. Show all posts

Monday, March 26, 2012

With dynamic created Tabs extender any postback produce error, and temporary fix

I found another bug with Tabs extender:

On the page aspx

<ajaxToolkit:TabContainerID="Tab1"runat="server"Width="300px"ScrollBars="Auto"Enabled="true"ActiveTabIndex="0"></ajaxToolkit:TabContainer>

Then from server side, I add several tabs, but any button, click on that page would produce error:

Line 44: public new TabPanel this[int index]
Line 45: {
Line 46: get { return (TabPanel)base[index]; }
Line 47: }
Line 48: }
Source File:C:\Inetpub\wwwroot\AtlasControlToolkit-14384\Development\AjaxControlToolkit\Tabs\TabPanelCollection.cs Line:46

I fixed it temporarily with file TabContainer.cs, line 302 by using try and catch:

protected override void LoadClientState(object clientState)
{
Dictionary<string, object> state = (Dictionary<string, object>)clientState;
if (state != null)
{
ActiveTabIndex = (int)state["ActiveTabIndex"];
object[] tabState = (object[])state["TabState"];
for (int i = 0; i < tabState.Length; i++)
{
try
{
Tabs[i].Enabled = (bool)tabState[i];
}
catch
{
continue;
}
}
}
}

The error is still exist with the newest build# 14429. Can someone at least put the try and catch block into the new build?

Wednesday, March 21, 2012

XHTML 1.1 validation and Atlas

Hello all,

Previously, I tried Atlas but abandoned it when it failed to produce valid XHTML 1.1 according to the W3C validator. The problem was that it did not recognize the tags inside the <script type="text/xml-script"> blocks, or the xmlns:script attribute.

Now, after surveying many other frameworks and finding them either lacking for my purposes or unable to run in a partial-trust environment, I'm turning back to see if Atlas can be made to work. Two questions:

    Has anyone come up with a workaround for the invalid XHTML?Is the XHTML really invalid, or is the W3C validator lying? (Please substantiate your claim if it's the latter.)
No ideas?
I need to know about this aswell if anyone can help?

XML namespaces and XHTML are a bit tricky. There are other Ajax toolkits wrangling with the same issue. It has to do with a lot of things, but is not unique to Atlas.

If you are interested, you can read some interesting information on XHTML and other namespaces athttp://www.w3.org/TR/xhtml1/normative.html.

http://www-128.ibm.com/developerworks/xml/library/x-namcar.html

And, for this topic in particular, see item 3 here

http://codinginparadise.org/weblog/2005/08/xhtml-considered-harmful.html

And, a possible solution, referenced via the previous (albeit circuitiously), create a custom DTD!http://www.alistapart.com/articles/customdtd/

How quaint. I thought DTD was deprecated by XML Schema... And, so we are to use a deprecated syntax to make XHTML (the future of HTML) work. Not only that, how is using a custom DTD compliant with XHTML anyway? Ah, well. I don't have any answers.

Sorry for the messy response. It's a messy problem.


Thanks very much for the info.