I have a UserControl which contains a TextBox and a CustomValidator.
I would like to set the CustomValidator.ServerValidate to a method in the page that contains the UserControl
I found this code which will allow me to dynamically set the custom validators validation function:
cusvCustom.ServerValidate += new System.Web.UI.WebControls...
I have read this before about asp.net mvc validations but does not mention what i want to do,So have this view model -
public class MyViewModel
{
[StringLength(200, MinimumLength = 2, ErrorMessage = "Invalid Name")]
public string Name { get; set; }
[Required(ErrorMessage = "*")]
public DateTime StartDate...
I want to use ajax with validator control.
for example, the various error messages should be show when a user input his/her name in a textbox to register:
if nothing is input, "you should input your name";
if not correct format, "your username is not valid formatted";
if the username has used by other user, "the usename has been used ...
Hi,
I have four dropdown lists with same items/values. I want to prevent the same value is chosen more than once when the form is uploaded. How can I do that using a custom validator? Thanks!
...
Hi,
How can I create a CustomValidator on Client Side for validating my file path from FileUpload?
Thanks
...
Hi everybody
Lets say I have this code.
<asp:TextBox ID="TextBox1" runat="server" />
<asp:CustomValidator ID="CustomValidator1" runat="server"
ClientValidationFunction="ValidationFunction1"
ControlToValidate="TextBox1"
Display="Dynamic" />
And a validationFunction:
function ValidationFunction1(sender, args)
{
}
And i ...
Hi, I have a custom validator (.net 3.5) that checks if four dropdown lists in my form have repeated values. It works on the server-side but I would like to add a client-side function to go with it. I have no knowledge of JavaScript. Could you help? Mant thanks.
<asp:CustomValidator id="CustomValidator1" runat="server" ErrorMessage = "...
Hi ,
Can anyone tell me whether i can use ValidatorCalloutExtender with Customvalidator which has server side validation? An example would be great.
thanks,
Niall
...
Hi guys,
I'm trying to implement a .NET Custom Validator that uses $.ajax to query a WebMethod on the same page and return a boolean value to indicate whether the result is true or false.
The WebMethod I'm using is really simple
[WebMethod()]
public static bool IsPromoValid(string code)
{
string promoCode = "ABCDEFG";
bool res...
Hello,
I have an ASP .NET page with ASP validators (Required Field, Regular Expression,...) plus java script functions for additional validation (for example, to check if second date bigger than first date, among others).
I usually do:
<script type="text/javascript">
function validate() {
// ...
alert('Not valid!'...