Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UpdatePanel Problem

I have a UpdatePannel Button and a TextBox.Button is inside the UpdatePannel control and the TextBox is out side the pannel control so i want print some text in the TextBox on the button click which is inside the UpdatePannel control.

<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
    <asp:Button ID="Button1" runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>

Any ideas????

I want the TextBox out side the SAME UpdatePannel.Button should be in the UpdatePannel.can i have 2 UpdatePannels.one for the TextBox and another for the Button????

like image 578
chamara Avatar asked Jan 25 '26 11:01

chamara


1 Answers

Actually the TextBox should be inside the update panel or outside with an update panel's trigger

<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
    <ContentTemplate> 
        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Button" />   
    </ContentTemplate>
</asp:UpdatePanel>

OR

<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
    <ContentTemplate> 
        <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
    </ContentTemplate>
    <Triggers>     
        <asp:AsyncPostBackTrigger ControlID="Button1" />     
    </Triggers> 
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" Text="Button" />
like image 82
Carlos Muñoz Avatar answered Jan 28 '26 01:01

Carlos Muñoz