This is a migrated thread and some comments may be shown as answers.

[Solved] Text property not updated

2 Answers 319 Views
Input
This is a migrated thread and some comments may be shown as answers.
Arild Bakken
Top achievements
Rank 1
Arild Bakken asked on 22 Oct 2007, 11:34 AM
I'm using the RadTextBox control with the RadAjaxManager. When a dropdown is changed, an Ajax update is triggered and the UI is updated. At this point, I can get the Text property of the RadTextBox and all is fine. However, when I now fill out the form and click the submit button, the value I get from that RadTextBox is the value entered before the first Ajax update. Any changed performed afterwards are not recognized by the RadTextBox on the serverside. Example that demonstrates the issue:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
<telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><br />
</telerik:RadAjaxPanel>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Button1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>


Codebehind: 

protected void Button1_Click(object sender, EventArgs e) {
  Button1.Text = RadTextBox1.Text;
}

The first time the button is clicked, the text from the RadTextBox is set as the button's caption. Any subsequent edit of the box and click on the button will not update the button caption - the value returned from the RadTextBox1.Text stays the same as the first click. What am I doing wrong?


Regards,

Arild

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 23 Oct 2007, 11:22 AM
Hi Arild,

When using RadAjaxManger it is not necessary to use RadAjaxPanel - you can replace the ajax panel with a regular panel. Here is an example:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="Button1">
              <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="Panel1" />
              </UpdatedControls>
         </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<asp:Panel ID="Panel1" runat="server" Height="200px" Width="300px">
    <telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><br />
</
asp:Panel
>



All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Arild Bakken
Top achievements
Rank 1
answered on 23 Oct 2007, 11:34 AM
Thanks, that did the trick :)
Tags
Input
Asked by
Arild Bakken
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Arild Bakken
Top achievements
Rank 1
Share this question
or