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

Can't read user input on postback

1 Answer 63 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Gaetano
Top achievements
Rank 1
Gaetano asked on 21 Mar 2013, 09:51 AM
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" >
    <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="btnSaveAdd" EventName="Click">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="fields" UpdatePanelRenderMode="Block" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="txtAddUsername" EventName="OnTextChanged" >
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="txtAddUSername" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<div>
    <asp:Panel id="fields" runat="server">
        <div class="addUserRow">
            <label>Username</label>
            <telerik:RadTextBox runat="server" ID="txtAddUsername" ClientIDMode="Static" OnTextChanged="txtAddUsername_TextChanged" AutoPostBack="true"></telerik:RadTextBox>
        </div>
        <div class="addUserRow">
            <label>Alias</label>
            <telerik:RadTextBox runat="server" ID="txtAddAlias" ClientIDMode="Static"></telerik:RadTextBox>
        </div>
        <div class="addUserRow">
            <label>Passowrd Temporanea</label>
            <telerik:RadTextBox runat="server" ID="txtAddPsw" ClientIDMode="Static"></telerik:RadTextBox>
        </div>
        <div class="addUserRow">
            <label>E-Mail</label>
            <telerik:RadTextBox runat="server" ID="txtAddMail" ClientIDMode="Static"></telerik:RadTextBox>
        </div>
        <div class="addUserRow">
            <label>Ruolo</label>
            <asp:DropDownList runat="server" ID="sltRole" ClientIDMode="Static"></asp:DropDownList>
        </div>
        <div class="addUserRow radioRow">
            <label>Tipo</label>
            <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>
        <div class="addUserRow">
            <label>Ragione Sociale</label>
            <telerik:RadTextBox runat="server" ID="txtAddRagSoc" Enabled="false" ClientIDMode="Static"></telerik:RadTextBox>
        </div>
        <div class="addUserRow">
            <label>Nome</label>
            <telerik:RadTextBox runat="server" ID="txtAddName" Enabled="false" ClientIDMode="Static"></telerik:RadTextBox>
        </div>
        <div class="addUserRow">
            <label>Cognome</label>
            <telerik:RadTextBox runat="server" ID="txtAddSurname" Enabled="false" ClientIDMode="Static"></telerik:RadTextBox>
        </div>
    </asp:Panel>
    <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>
    </div>
</div>

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...

Thanks 



1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 26 Mar 2013, 07:41 AM
Hello,

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,
Andrey
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.
Tags
Ajax
Asked by
Gaetano
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or