Questions tagged [validation-controls]
31 questions
4
votes
1 answer
Error throws using ModelClientValidationRule in MVC 5?
I try to do the custom client side validation in MVC 5 Project. When I add the following code:
public IEnumerable GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
{
//Some Validation Here
…

CrazyCoderT
- 63
- 7
4
votes
1 answer
How do you reenable a validation control w/o it simultaneously performing an immediate validation?
When I called this function to enable a validator from client javascript:
`ValidatorEnable(document.getElementById('<%=valPassportOtherText.ClientID%>'), true); //enable` validation control
the required validation control immediately performed it…
user330100
4
votes
1 answer
Asp.net Dynamic Validators don't work in Chrome or Safari
Ok, I'm dynamically creating Asp.net validation controls and inserting them into an update panel. The validation works in IE and Firefox, but not in Chrome or Safari.
Here is the aspx file. Don't ask why I'm not using a button server control...
…

Chad
- 1,404
- 1
- 18
- 29
3
votes
3 answers
Why ValidatorValidate() validates all the RequiredFieldValidator controls on the page?
In following code Why ValidatorValidate(v) validates all the RequiredFieldValidator controls on the page? It should execute only RequiredFieldValidator1 not RequiredFieldValidator2. Here is code.
…

Amit
- 21,570
- 27
- 74
- 94
3
votes
1 answer
Custom Control referenced by 'RequiredFieldValidator' cannot be validated
Question: How do I correctly extend a custom control to work with the RequiredFieldValidator? I've read this, but trying to implement it didn't solve the problem for me.
This is what I've come up with so far:
<%@ Register…

Soroush Hakami
- 5,226
- 15
- 66
- 99
3
votes
0 answers
ASP.NET Validate all validators with different validation groups
I'm writing an ASP.NET page and trying to get validation working. My problem is that I've got a repeater that contains several custom grid controls, each of which has validators and a validation summary.
At first, I didn't assign any validation…

Turner Hayes
- 1,844
- 4
- 24
- 38
3
votes
4 answers
Are validation server controls better than javascript in any way?
Are validation server controls better than javascript in any way ? Do they restrict us as we are only able to use the functionality that is provided by them. Please help me on this. I read about validation server controls on my own blog

HotTester
- 5,620
- 15
- 63
- 97
2
votes
4 answers
firing both onclientclick and Client side validation from validation control on button Client click
I have few ASP Text Box controls on a Page, to which Custom Validators are added. I have Save Button, which validates these Text boxes. I have just added the Validation Group as same as that of the Text boxes.
In order to incorporate addtional…

suryakiran
- 1,976
- 25
- 41
1
vote
3 answers
Is it possible to use ASP.NET validation controls when I need to modify HTML when validation fails?
Let's say that I have the following HTML for a text box on an ASP.NET page:
It is easy enough to add a required field validator to this page like…

Corey Burnett
- 7,312
- 10
- 56
- 93
1
vote
2 answers
regular expression to blacklist potentially dangerous strings
What regular expression should be used to blacklist the character sequence that would cause the following error in ASP.Net - "A potentially dangerous Request.Form value was detected from the client". (e.g. < br >, < hi >, < a > etc..)
I need to use…

Navaneeth
- 190
- 1
- 1
- 16
1
vote
1 answer
From client, force whole page validation
I have an ASP button for which I have set the OnClientClick property to display a javascript confirm message. However, I only want this message to be displayed AFTER all of the client side validations have passed.
How can I do this? Essentially, I…

Chad
- 23,658
- 51
- 191
- 321
1
vote
2 answers
How do you clear a CustomValidator Error on a Button click event?
I have a composite User control for entering dates:
The CustomValidator will include server sided validation code. I would like the error message to be cleared via client sided script if the user alters teh date value in any way. To do this, I…

Chad
- 23,658
- 51
- 191
- 321
1
vote
3 answers
Range Validator is not working in asp.net Minimum and Maximum Value
I have applied RangeValidator on TextBox. But it always shows me error : Invalid Range, though I have given minimum value 10 and maximum value 25. I want that user must not enter value whose length is less than 10 and greater than 25. I want that…

Afnan Ahmad
- 2,492
- 4
- 24
- 44
1
vote
1 answer
Events on Master Page event not firing with Validation Controls
I have applied some textboxes in content pages. I have applied some Validations Controls on it.
What i have done so far is this,

user1884709
- 145
- 1
- 3
- 14
1
vote
2 answers
ASP.Net web application - server side canceling Submit PostBackUrl if not(!) Page.IsValid
I have a web application, and the submit uses the PostBackUrl to display data if the form is valid.
I need to use different (server side) validation groups, depending on what radiobutton is selected. That is, manually call…

Brent
- 4,611
- 4
- 38
- 55