RadTextBox modified?

4 posts, 0 answers
  1. John
    John avatar
    44 posts
    Member since:
    Apr 2011

    Posted 03 Oct 2013 Link to this post

    Is there some property of a radtextbox that can be retrieved in the codebehind that indicates whether the value has been modified?  for a password field, I need to know if it has been modified, and if it has not been modified, not modify the password store on the back end. 
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Oct 2013 Link to this post

    Hi John,

    The OnTextChanged event only occurs if the value of the RadTextBox control actually Changes from there you can access the modified text. Please have a look into the following code that I tried to access the modified text in code behind.

    ASPX:
    <telerik:RadTextBox ID="RadTextBox1" runat="server" Text="Value1" AutoPostBack="true"
        OnTextChanged="RadTextBox1_TextChanged">
    </telerik:RadTextBox>

    C#:
    protected void RadTextBox1_TextChanged(object sender, EventArgs e)
    {
        string  modifiedText;
        modifiedText = RadTextBox1.Text;
    }

    Thanks,
    Shinu.
  3. John
    John avatar
    44 posts
    Member since:
    Apr 2011

    Posted 04 Oct 2013 Link to this post

    Sorry.  I already know how to capture on changed on both the client in javascript and in the codebehind in c#.  I was hoping that there would be a property of the control that I could retrieve rather than capturing the event in javascript and then setting the value of a hidden control that I would then retrieve on form submission.  This is particularly important for password fields because the text in a password cannot be set from the codebehind. 
  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 09 Oct 2013 Link to this post

    Hello John,

    There is no available property that will indicate either the input has changed or not. The only possible approach is the one that Shinu have shown and for your particular requirement, as you have mentioned, you could use HiddenField to store the previously entered password and compare the new value with the value from the HiddenField when needed.

    I will be glad to assist if other questions arise. 


    Regards,
    Konstantin Dikov
    Telerik
    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 the blog feed now.
Back to Top