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

RadInputManager Validation Code Behind

1 Answer 102 Views
Input
This is a migrated thread and some comments may be shown as answers.
juststarting
Top achievements
Rank 2
juststarting asked on 21 Apr 2011, 10:41 AM
Hi,

I have a VB.net web application with a RadInputManager validation on 2 fields (email address & password). Both these fields must be completed.

<asp:TextBox ID="txtEMail" MaxLength="100" runat="server" Width="250px" />
<asp:TextBox ID="txtPassword" MaxLength="50" runat="server" Width="250px" TextMode="Password" />
 
<asp:Button ID="cmdLogin" runat="server" Text="Login" />
  
    <telerik:RadInputManager ID="RadScreenValidator" runat="server">
        <telerik:TextBoxSetting BehaviorID="IsRequired" Validation-IsRequired="true">
            <TargetControls>
                <telerik:TargetInput ControlID="txtPassword" />
            </TargetControls>
        </telerik:TextBoxSetting>
        <telerik:RegExpTextBoxSetting BehaviorID="ValidateEMail" Validation-IsRequired="true" ValidationExpression="^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$">
            <TargetControls>
                <telerik:TargetInput ControlID="txtEMail" />
            </TargetControls>
        </telerik:RegExpTextBoxSetting>
    </telerik:RadInputManager>

When the user click on the login button, I check if the email address supplied is in fact of a valid domain using DNS lookup.

How do I return to the RadInputManage that the validation failed as I dont use any Error messages but rather the yellow warning sign error indicator on the textbox itself.

Keep in mind that if the email is correctly confirmed in the database & the password is wrong, I just want to warn the user regarding the password not the email address also.

Thanx

1 Answer, 1 is accepted

Sort by
0
Accepted
Maria Ilieva
Telerik team
answered on 27 Apr 2011, 08:41 AM
Hello,

One possibility for this scenario is to pass StartUp Script from the server and on the client just change the css class of the mentioned input to the invalid one.
Another option could be to use RadInput controls for which you could call invalid in the specific statement. For example:
radinput1._invalidate();
radinput1.updateCssClass();


Best wishes,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Input
Asked by
juststarting
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Share this question
or