adding controls dynamically to panel in a UpdatePanel asp.net 4.0

Posted by softwaremonster on Stack Overflow See other posts from Stack Overflow or by softwaremonster
Published on 2010-06-15T00:28:49Z Indexed on 2010/06/15 0:32 UTC
Read the original article Hit count: 516

Filed under:
|

Hi,

I have a UpdatePanel includes some panels. I want to add to these panel some controls according to the operations. After i click any button twice or after first page load the page gives error. Either I have to use each panel without any post back [no page refresh] how can i solve this? the html code is below.

wordOrgButton enables word panel and after any operation fills that word panel. same for userOrgButton

<asp:UpdatePanel ID="mainPanel" runat="server" Height="220px">
    <ContentTemplate>
    <fieldset>
        <asp:Panel ID="buttonsPanel" runat="server">
            <asp:Button ID="wordOrgButton" runat="server" Text="Words" 
                onclick="wordOrgButton_Click" />
            <asp:Button ID="userOrgButton" runat="server" Text="User" 
                onclick="userOrgButton_Click" />
            <asp:Button ID="exitButton" runat="server" Text="Exit" 
                onclick="exitButton_Click" />
        </asp:Panel>
        <asp:Panel ID="usersPanel" runat="server">
            <asp:TextBox ID="whoisUserTextBox" runat="server"></asp:TextBox>
            <asp:Button ID="catchUserButton" runat="server" Text="Bring" 
                onclick="catchUserButton_Click" />
        <asp:Panel ID="userOrgPanel" runat="server" ></asp:Panel>
        </asp:Panel>
        <asp:Panel ID="wordsPanel" runat="server"></asp:Panel>
        <asp:Panel ID="informationPanel" runat="server">
            <asp:Label ID="operationinfoLabel" runat="server"></asp:Label>
        </asp:Panel>
        </fieldset>
        </ContentTemplate>
    </asp:UpdatePanel>

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about updatepanel