Saturday, March 24, 2012

Upgraded to RC but the Bug lurks

Hi,

I have upgraded to AJAX RC version from AJAX Beta 2...... I have a Page that has a MasterPage and I'm building an HtmlTable at runtime and Add to an already existing Panel in this Page. This Panel is in an UpdatePanel.. It doesn't simply does a full postback and not an asyncronous one...

This seeems to be something related to a MasterPage since when done without a MasterPage it just works fine

please shed a bit of light on this... this is a bug that lurked from Beta 1.. anyone knows why...?

Thanks !

so no one knows or happened to come across it?

please!


Can you provide the source code. If there is no javascript error on page, I believe it might be something to do with the web.config. Make sure that legacy rendering is OFF in web.config.

vineetc


source code?

Panel1 is inside an UpdatePanel with a MasterPage.

Panel1.Controls.Clear();
Panel1.Controls.Add(new Template_cls().BuildTemplate(3, 3, 2));

BuildTemplate method returns an HtmlTable and adds it to Panel1.

...... the same code applied to a page without a MasterPage works fine.

In the web.config I have no legacy rendering .. doesn't exist. The Web.Config is updated with the latest release of the RC version.

Thanks!


I don't know why no-one wants to answer... possible that no-one uses MasterPages with UpdatePanels and creating controls at runtime?!....there's a bug

hmm... actually that works fine yes...maybe I didn't describe myself correctly

What you said is part of it and works fine. I'm adding a GridView control at runtime. The GridView has the "Select" commands. When I click the "Select" command it does a full postback to the server even though its under the UpdatePanel!


Thanks and sorry for not describing myself correctly.


I tried something like this and everything worked fine.

<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="panel1" runat="server">
<asp:Button ID="Button2" runat="server"Text="Button" OnClick="Button2_Click"></asp:Button>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:ContentPlaceHolder>
</div>
</form>

On Button2_Click, I add a control inside the panel.

protected void Button2_Click(object sender, EventArgs e)
{
Label lb = new Label();
lb.Text = "label";
this.panel1.Controls.Add(lb);
}

You need to verify that legacy rendering is OFF in your web.config. You might have to move up the hierarchy of your website and see if there are any web.configs where it might be on.

vineetc


So basically it makes a full postback when a GridView with "select" commands is added to an HtmlTable which in turn is added to a Panel that is under an UpdatePanel AND also when the Page has a MasterPage. It makes a full postback when you click on the GridView "select" command button. Both HtmlTable and GridView are added at runtime.

This is a very specific error, I'm sure its a bug so please check it out!!. It works well without MasterPages. I don't know whats with the GridView "Select" commands when under a UpdatePanel pertaining to a page has a MasterPage.

Thanks!!

No comments:

Post a Comment