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

Value of RadTextBox inside RadAjaxPanel

3 Answers 135 Views
Input
This is a migrated thread and some comments may be shown as answers.
Cody
Top achievements
Rank 1
Cody asked on 09 Jul 2010, 08:35 PM
Hi guys,
I'm making a simple page where a user has a radtextbox which is initially disabled. When a user clicks 'edit', the textbox is enabled, and can change the values. They can then hit 'save' to ideally change the value, but it doesn't seem to persist when clicked. It always remembers the old value. Say I had something to edit and the text said 'Here is the default text'. I would click edit, then when the radtextbox became enabled, I would add to it to have it say 'Here is the default text, plus more!'. Whenever I click 'save' though, the ajax panel that they are all in reloads, but has the same old text. I try to take the .text value from the radtextbox and it is always the old value. I realize that the server only knows the old value but I am completely unsure of how to get the text from the client side. Any help?
Thanks,
Cody

3 Answers, 1 is accepted

Sort by
0
Cody
Top achievements
Rank 1
answered on 09 Jul 2010, 09:10 PM
Basically, all I want is for my save button (located in the same radajaxpanel as the radtextbox)  to be able to call a function with one parameter being the latest text of the radtextbox on click. Been messing around with clientevents and server side code but have not found a solution to something that seems like it should be rather easy.
0
Cody
Top achievements
Rank 1
answered on 10 Jul 2010, 02:30 PM
I am seriously screwed if I can't figure this out today. My entire app hinges on it working properly. UpdateItem never uses the most recent client radtextbox text. Here is a basic idea of my form and code:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
 
     <Telerik:RadTextBox ID="txtBrandMessageAP" runat="server"  enabled="false"
               TextMode="MultiLine" Height="60px"
              Width="600px" AutoPostBack="True" >
       </Telerik:RadTextBox><br />
   <asp:LinkButton ID="btnEditBrandMessageAP" runat="server"   Text="Edit" />
          <asp:LinkButton ID="btnSaveBrandMessageAP" runat="server" Visible="false" Text="Save" />
          <asp:LinkButton ID="btnCancelBrandMessage"  runat="server" Visible="false" Text="Cancel" />
           <asp:Label ID="lblbrandmessageAPEditedBy" runat="server" Text="Last Edited by:"></asp:Label>
      
</telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"
          Skin="Simple" />
Protected Sub btnSaveBrandMessageAP_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveBrandMessageAP.Click
        Dim updateField(0) As String
        updateField(0) = "Brand_x0020_Messaging_AP"
  
        Dim updateText(0) As String
  
        updateText(0) = txtBrandMessageAP.Text
        btnEditBrandMessageAP.Visible = True
        btnSaveBrandMessageAP.Visible = False
        btnCancelBrandMessage.Visible = False
        Try
             
            updateItem("Dealer_Info", "Brand_x0020_Messaging_AP", "1", updateField, updateText)
        Catch ex As Exception
              
        End Try
  
  
  
  
  
  
    End Sub
0
Maria Ilieva
Telerik team
answered on 12 Jul 2010, 01:11 PM
Hi Cody,

Could you please let me know whether the problem persists if the ajax is disabled on the page. Also please let me know what is the result if a regular asp UpdatePanel is used.

Sincerely yours,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Input
Asked by
Cody
Top achievements
Rank 1
Answers by
Cody
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or