RadTextBox not giving text

4 posts, 0 answers
  1. Riccardo
    Riccardo avatar
    7 posts
    Member since:
    Mar 2011

    Posted 31 Mar 2011 Link to this post

    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
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 01 Apr 2011 Link to this post

    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.
  3. Riccardo
    Riccardo avatar
    7 posts
    Member since:
    Mar 2011

    Posted 01 Apr 2011 Link to this post

    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
  4. Riccardo
    Riccardo avatar
    7 posts
    Member since:
    Mar 2011

    Posted 01 Apr 2011 Link to this post

    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
Back to Top