Click here to Skip to main content
15,890,336 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Write to CSV in C# asp.net Pin
ToddHileHoffer19-May-09 4:37
ToddHileHoffer19-May-09 4:37 
QuestionWhy does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
bigmish218-May-09 4:18
bigmish218-May-09 4:18 
AnswerRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
Ian McCaul18-May-09 4:47
Ian McCaul18-May-09 4:47 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
bigmish218-May-09 5:04
bigmish218-May-09 5:04 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
El_Programmer18-May-09 5:25
El_Programmer18-May-09 5:25 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
bigmish218-May-09 6:06
bigmish218-May-09 6:06 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
El_Programmer18-May-09 6:31
El_Programmer18-May-09 6:31 
GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
N a v a n e e t h18-May-09 6:37
N a v a n e e t h18-May-09 6:37 
Page.IsValid is used to check the validation status at server side. Validation control uses JS by default to do the validation. Since JS is not reliable, ASP.NET does server side validations also to make sure validation logic is not bypassed and set the IsValid flag. So before you continue with your action, check the page is valid. Something like
If(this.IsValid)
   // continue
bigmish2 wrote:
I’m looking for a way to run the source code and within that source code programmatically determine if the page is valid (meaning a validaters = true) and do something it is and something else if its not.


When validator controls are added, by default the validation will happen at the client side. So validating programatically at server side is pointless as form will not postback if there are validation errors. To do the validations on server, you have to disable client side validations first. Set the EnableClientScript property of the validation control to false.

Page class exposes a Validators[^] collection where you can iterate and call Validate() method on each validator to perform the validation. Check the IsValid property to get the status of validation.

Smile | :)


GeneralRe: Why does button’s click subroutine not execute when RequiredFieldValidator is false? Pin
bigmish218-May-09 7:21
bigmish218-May-09 7:21 
QuestionSession Size Pin
mehrdadc4818-May-09 4:11
mehrdadc4818-May-09 4:11 
AnswerRe: Session Size Pin
N a v a n e e t h18-May-09 6:13
N a v a n e e t h18-May-09 6:13 
AnswerRe: Session Size Pin
Yusuf18-May-09 6:46
Yusuf18-May-09 6:46 
AnswerRe: Session Size Pin
Manas Bhardwaj18-May-09 9:08
professionalManas Bhardwaj18-May-09 9:08 
QuestionSet Tablndex To a UserControl which is present inside ModalpopupExtender Pin
Pawan Kiran18-May-09 3:38
Pawan Kiran18-May-09 3:38 
AnswerRe: Set Tablndex To a UserControl which is present inside ModalpopupExtender Pin
Herman<T>.Instance18-May-09 4:18
Herman<T>.Instance18-May-09 4:18 
GeneralRe: Set Tablndex To a UserControl which is present inside ModalpopupExtender Pin
Pawan Kiran19-May-09 3:53
Pawan Kiran19-May-09 3:53 
GeneralRe: Set Tablndex To a UserControl which is present inside ModalpopupExtender Pin
Herman<T>.Instance19-May-09 4:09
Herman<T>.Instance19-May-09 4:09 
GeneralRe: Set Tablndex To a UserControl which is present inside ModalpopupExtender Pin
Pawan Kiran19-May-09 22:54
Pawan Kiran19-May-09 22:54 
GeneralRe: Set Tablndex To a UserControl which is present inside ModalpopupExtender Pin
Herman<T>.Instance19-May-09 23:19
Herman<T>.Instance19-May-09 23:19 
GeneralRe: Set Tablndex To a UserControl which is present inside ModalpopupExtender Pin
Pawan Kiran20-May-09 4:14
Pawan Kiran20-May-09 4:14 
Questionproblem at the time of edit in gridview Pin
prateekfgiet18-May-09 1:58
prateekfgiet18-May-09 1:58 
AnswerRe: problem at the time of edit in gridview Pin
scottgp18-May-09 2:15
professionalscottgp18-May-09 2:15 
GeneralRe: problem at the time of edit in gridview Pin
prateekfgiet18-May-09 20:32
prateekfgiet18-May-09 20:32 
QuestionPath issue ..Plz help Urgent Pin
antony beula18-May-09 1:33
antony beula18-May-09 1:33 
AnswerRe: Path issue ..Plz help Urgent Pin
Oakman18-May-09 2:20
Oakman18-May-09 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.