Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

vam:requiredtextvalidator how to enable it on codebehind?

vam:requiredtextvalidator how to enable it on codebehind?
i want to do it dynamicaly on the basis of a business logic. please help
0
x1877
Asked:
x1877
  • 2
1 Solution
 
Anurag ThakurTechnical ManagerCommented:
0
 
x1877Author Commented:
Thats a good site ragi0017 - Thanks
0
 
x1877Author Commented:
This is the code i added to get this done

i set the enabled property to false on design time.

<vam:requiredtextvalidator enabled="false"


and added the following code on code behind. So it will enabled only if the businse case matches
RequiredTextValidator vldEditPrimaryDayPhoneRequired = ctlWorkflow.FindControl("vldEditPrimaryDayPhoneRequired") as RequiredTextValidator;
						vldEditPrimaryDayPhoneRequired.Enabled = true;
	vldEditPrimaryDayPhoneRequired.EnableClientScript = true;

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now