Wednesday, March 21, 2012

Atlas renders duplicated buttons...

Hi, All:

Please check the following code:

put updatePanel within a table will duplicate button and dropdownlist.

remove table tag is fine though.

Is this a bug?

---------------------

<%@dotnet.itags.org.PageLanguage="C#" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<scriptrunat="server">

void Button1_Click(object sender,EventArgs e)

{

listMatter.Items.Clear();

listMatter.Items.Add("text1");

listMatter.Items.Add("text2");

}

</script>

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

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

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

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true">

</atlas:ScriptManager>

<div>

<table>

<atlas:UpdatePanelID="up1"Mode="Conditional"runat="server">

<Triggers>

<atlas:ControlEventTriggerControlID="Button1"EventName="Click"/>

</Triggers>

<ContentTemplate>

<tr><td>

<asp:LinkButtonID="Button1"runat="server"OnClick="Button1_Click"Text="Button"/>

Matter:

</td>

</tr>

<tr><td>

<asp:DropDownListID="listMatter"runat="server"></asp:DropDownList>

</td></tr>

</ContentTemplate>

</atlas:UpdatePanel>

</table>

</div>

</form>

</body>

</html>

not to get too far off topic here but...
why would you create a table and then the update panel control?

is your intent to create a row that is updatable?
interesting concept if you are... (most would create a table cell and then the update panel or use divs instead)

i don't really know but i would look to see if using the "tbody" helps in any way
the reason why i say that is because there are instances that i have seen where the "tbody" must be present for some "features" to work properly in Atlas


Hi,

I think the problem is that the UpdatePanel wraps its content with a div or span tag, thus the markup for the table is like:

<table>
<div><!-- div as first child of table -->
...
</div>
</table>
and this cause problems when replacing the updated HTML using the DOM. I would place the UpdatePanel inside the cell, to wrap only the DropDownList, like meisinger suggested.

No comments:

Post a Comment