Can't read user input on postback

2 posts, 0 answers
  1. Gaetano
    Gaetano avatar
    71 posts
    Member since:
    May 2012

    Posted 21 Mar 2013 Link to this post

    Hi everybody!
    I'm trying to develop a custom add user form with telerik controls for asp .net.

    here is my code:
    <telerik:RadAjaxManager ID="RadAjaxManager" runat="server" >
             <telerik:AjaxSetting AjaxControlID="btnSaveAdd" EventName="Click">
                    <telerik:AjaxUpdatedControl ControlID="fields" UpdatePanelRenderMode="Block" />
            <telerik:AjaxSetting AjaxControlID="txtAddUsername" EventName="OnTextChanged" >
                    <telerik:AjaxUpdatedControl ControlID="txtAddUSername" />
        <asp:Panel id="fields" runat="server">
            <div class="addUserRow">
                <telerik:RadTextBox runat="server" ID="txtAddUsername" ClientIDMode="Static" OnTextChanged="txtAddUsername_TextChanged" AutoPostBack="true"></telerik:RadTextBox>
            <div class="addUserRow">
                <telerik:RadTextBox runat="server" ID="txtAddAlias" ClientIDMode="Static"></telerik:RadTextBox>
            <div class="addUserRow">
                <label>Passowrd Temporanea</label>
                <telerik:RadTextBox runat="server" ID="txtAddPsw" ClientIDMode="Static"></telerik:RadTextBox>
            <div class="addUserRow">
                <telerik:RadTextBox runat="server" ID="txtAddMail" ClientIDMode="Static"></telerik:RadTextBox>
            <div class="addUserRow">
                <asp:DropDownList runat="server" ID="sltRole" ClientIDMode="Static"></asp:DropDownList>
            <div class="addUserRow radioRow">
                <input type="radio" name="userType" value="Privato" class="btnRadio" id="rdPrivate" />privato
                <input type="radio" name="userType" value="Azienda" class="btnRadio" id="rdCompany" />Azienda
            <div class="addUserRow">
                <label>Ragione Sociale</label>
                <telerik:RadTextBox runat="server" ID="txtAddRagSoc" Enabled="false" ClientIDMode="Static"></telerik:RadTextBox>
            <div class="addUserRow">
                <telerik:RadTextBox runat="server" ID="txtAddName" Enabled="false" ClientIDMode="Static"></telerik:RadTextBox>
            <div class="addUserRow">
                <telerik:RadTextBox runat="server" ID="txtAddSurname" Enabled="false" ClientIDMode="Static"></telerik:RadTextBox>
        <div class="buttonStripAdd">
            <telerik:RadButton runat="server" ID="btnCancelAdd" OnClientClicked="MyAxitea_Settings.CloseAddWin" Text="Annulla"></telerik:RadButton>
            <telerik:RadButton runat="server" ID="btnSaveAdd" OnClick="btnSaveAdd_Click" Text="Salva" UseSubmitBehavior="true" AutoPostBack="true" SingleClick="true"></telerik:RadButton>

    and I have some issues.

    First of all I can't get any value inserted on client side on textboxes...
    on page_load (if !IsPostBack) i write some random data inside textboxes, then I modify it and on save click I'm not able to get the modified value.
    any idea? 

    furthermore, if I remove SingleClick="true" I'm not even able to hit my breakpoint on btnSaveAdd_Click...
    If I use SingleClick the button never gets back in enable state after first click...
    in the end I added an OnTextChanged event to a textbox but I didn't manage to hit the handler on server side...
    what am I doing wrong?

    this code is inside an user control that will shows up on a kendo windows...while if I place this code in a brand new page it works...


  2. Andrey
    Andrey avatar
    836 posts

    Posted 26 Mar 2013 Link to this post


    Thank you for contacting us.

    I am not sure with which controls you have problems in particular, however, what you could do is:
    • First, remove the EventName attributes from the AjaxSettings.
    • Second, remove the Enabled=false attribute and if needed replace it with ReadOnly=true attribute.

    Additionally, if possible please send a sample project that replicates the issue. Thus I will be able to test debug the project locally and let you know what could possibly lead to this behavior.

    Best regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top