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

Radnotification and reset value radtextbox

3 Answers 142 Views
Notification
This is a migrated thread and some comments may be shown as answers.
Fabio Cirillo
Top achievements
Rank 1
Fabio Cirillo asked on 18 Dec 2012, 09:04 AM
Hi guys,
i've created a page asp to process of change password....there are 3 radtextbox. One radtextbox for old password and two radtextbox for new and confirm password. When there's one error i use the radnotification for to see the message but when load the radnotification form code behind, the value into radtextbox are reset, why? how can do it?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 18 Dec 2012, 11:17 AM
Hi,

I tried to replicate the issue that you are facing at my end under the version 2012, 3, 1016, 35 . But no avail. Following is the sample code that worked as expected at my end.

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

C#:
protected void RadTextBox1_TextChanged(object sender, EventArgs e)
{
    RadNotification1.Show();
}

Please provide your entire code where I can replicate the issue if it doesn't helps.

Regards,
Princy.
0
Fabio Cirillo
Top achievements
Rank 1
answered on 18 Dec 2012, 11:35 AM
into vb net i wrote this code:

Protected Sub Txtpwdnewconf_TextChanged(sender As Object, e As System.EventArgs) Handles Txtpwdnewconf.TextChanged
    If Txtpwdnew.Text <> Txtpwdnewconf.Text Then
        Me.RadNotification1.Show("Conferma password non errata.")
    End If
End Sub

but nothing the problem there's...the values of the radtextbox (txtpwdnew and txtpwnconf) are reset after load event  Txtpwdnewconf_TextChanged
0
Princy
Top achievements
Rank 2
answered on 19 Dec 2012, 04:19 AM
Hi,

Since it is a password field it is the expected behavior for security reasons.All the other fields are saved in ViewState and repopulated on postback, but not password fields. One suggestion to retain the value is that you can show the RadNotification using the OnValueChanged client event as follows.

ASPX:
<telerik:RadTextBox ID="Txtpwdnew" runat="server" TextMode="Password">
</telerik:RadTextBox>
<telerik:RadTextBox ID="Txtpwdnewconf" runat="server" TextMode="Password" ClientEvents-OnValueChanged="OnValueChanged">
</telerik:RadTextBox>
<telerik:RadNotification ID="RadNotification1" runat="server" Text="RadNotification">
</telerik:RadNotification>

JS:
<script type="text/javascript">
    function OnValueChanged(sender, args) {
        var Txtpwdnewconf = sender;
        var Txtpwdnew = $find("<%= Txtpwdnew.ClientID %>");
         var notification = $find("<%= RadNotification1.ClientID %>");
         if (Txtpwdnew.get_value() != Txtpwdnewconf.get_value()) {
             notification.show();
         }
    }
</script>

Hope this helps.

Regards,
Princy.
Tags
Notification
Asked by
Fabio Cirillo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Fabio Cirillo
Top achievements
Rank 1
Share this question
or