This is a migrated thread and some comments may be shown as answers.
RadTextBox not giving text
3 Answers 71 Views
This is a migrated thread and some comments may be shown as answers.
Riccardo
Top achievements
Rank 1
Riccardo asked on 31 Mar 2011, 04:53 PM
Hi all,
I've got a problem with radtextbox in my page. If I use javascript to insert text in a RadTextBox I can do it easily and it works well, but if I try to access thata text server-side, radtextbox.text property is ALWAYS empty, even if I type into it, not only if I set it using Javascript.

My text box is defined as follow
<telerik:RadTextBox TextMode="MultiLine" runat="server" ID="txtNote" MaxLength="512" Rows="5" Width="100%" />

Kind regards
Riccardo

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 01 Apr 2011, 07:44 AM
Hello Riccardo


I am surprised of the unexpected bahaviour and such scenario never happened at my side. Have you ajaxified the control? If so make sure that you set the AjaxSettings properly.

Could you provide some more information about the code that you tried?


Regards,
Princy.
0
Riccardo
Top achievements
Rank 1
answered on 01 Apr 2011, 07:57 AM
Hi Princy,
here is page layout and script side function:

<%@ Page Title="" Language="VB" MasterPageFile="~/master/MasterPage.master" AutoEventWireup="false" CodeFile="frmNote.aspx.vb" Inherits="NuovoOrdine_frmNote" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Contenuto" Runat="Server">
    <script type="text/javascript">
        function ScriviNota() {
            var cbo = new getObj('<%= cboNote.ClientID %>');
            var txt = $find('<%= txtNote.ClientID %>');
            if (cbo.obj.value != "") 
            {
                txt.set_value(txt.get_value() + " " + cbo.obj.value + "\n");
                txt.updateDisplayValue();
            }
        }
    </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
<asp:ImageButton EnableViewState="false" ID="cmdConferma" runat="server" ImageUrl="~/Img/NuovoOrdine/Ok.gif" CssClass="NuovoOrdine_ImmaginiPulsantiNavigazione" ToolTip="Conferma"/>
                <telerik:RadComboBox runat="server" ID="cboNote" Width="100%" MarkFirstMatch="true" HighlightTemplatedItems="true"                       OnClientSelectedIndexChanged="ScriviNota"/>
<telerik:RadTextBox TextMode="MultiLine" runat="server" ID="txtNote" MaxLength="512" Rows="5" Width="100%" />
</ContentTemplate>
    </asp:UpdatePanel>



And this is server side function linked to image button:

Protected Sub cmdConferma_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles cmdConferma.Click
        dim var as string= txtNote.Text
        Response.Redirect(Mypage, False)
    End Sub

Kind regards
Riccardo
0
Riccardo
Top achievements
Rank 1
answered on 01 Apr 2011, 08:17 AM
Hi Princy,
I've solved. It was linked to postback events that reloaded page with enableviewstate set to false that empty my control.

Thank you very much for your support

Kind regards
Riccardo
Tags
Input
Asked by
Riccardo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Riccardo
Top achievements
Rank 1
Share this question
or