If we add a textbox and give the required field
validator,and i add two radio buttons 1 is yes another one
is No.And i add another one server control button ,if i
click the button ,if the radio button Yes is checked the
validation control is fired ,if no the validation control
is not fired.So what you used to solve this problem.
Answers were Sorted based on User's Feedback
Answer / vijay
required field valodator is used to check where a browser
has entered a value in atextbox or not.
| Is This Answer Correct ? | 57 Yes | 24 No |
Answer / smriti
Hi,
We can add the code in page_load
If Me.RadioButton1.Checked = True Then
Button1.CausesValidation = True
Else
If Me.RadioButton2.Checked = True Then
Me.Button1.CausesValidation = False
End If
End If
| Is This Answer Correct ? | 37 Yes | 15 No |
Answer / yogesh sharma
Set both radio buttons AutoPostBack property to true.
and following code in page_load:
if (RadioButtonNo.Checked == true)
{
this.Button1.CausesValidation = false;
}
else
{
this.Button1.CausesValidation = true;
}
| Is This Answer Correct ? | 16 Yes | 9 No |
Answer / vijay
Set causes validation on the button to false. Add a custom
javascript function to the onclick event of that button. In
the javascript function check whether the radio button is
checked or not then. If checked call ValidatorEnable
(regValidatorId, true) and then call Page_ClientValidate()
function.
| Is This Answer Correct ? | 9 Yes | 7 No |
Required Field Validator does not depend upon any server
control either it is enable or disable.Means if radio
button1 is enable and radiobutton2 is disable at same time
then u press button then by default validation control
fired also in vice-versa case
| Is This Answer Correct ? | 11 Yes | 12 No |
Answer / ranga
Required validator checks for TextBox empty or not..
so to solve this problem
RequiredField validator--->properties..>validationGroup:sbmt
Button --->properties..>validationGroup:sbmt
| Is This Answer Correct ? | 7 Yes | 8 No |
Can you explain how ASP.NET application life cycle and page life cycle events fire?
How does u call and execute a sp in .net?
What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState ?
Define a static class?
If we add a textbox and give the required field validator,and i add two radio buttons 1 is yes another one is No.And i add another one server control button ,if i click the button ,if the radio button Yes is checked the validation control is fired ,if no the validation control is not fired.So what you used to solve this problem.
any body help me. Is it possible to convert text in gif images into word document with the same text? thanks in advance.
What is role-based security in asp.net?
What does it mean your session has timed out?
Is it necessary to lock application state before accessing it ?
Differentiate session and cookie
Define web.config in .net?
What are the main differences between asp and asp.net?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)