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

RadTextBox modified?

3 Answers 81 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 03 Oct 2013, 04:15 PM
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. 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Oct 2013, 06:55 AM
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.
0
John
Top achievements
Rank 1
answered on 04 Oct 2013, 05:09 PM
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. 
0
Konstantin Dikov
Telerik team
answered on 09 Oct 2013, 11:19 AM
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.
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
John
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or