Adding attribute to JavaScript validator object in the Page_Validators array

J

Jim Ox

I have created a custom validator control that implements the
BaseValidator. However I would like to add an attribute to the
JavaScript validation object that is rendered at the bottom of the
page. Currently something like the following is at the bottom of the
page:

var ctl00_MasterPages_MemberSelected = document.all ?
document.all["ctl00_MasterPages_MemberSelected"] :
document.getElementById("ctl00_MasterPages_MemberSelected");
ctl00_MasterPages_MemberSelected.errormessage = "This is an error
message";
ctl00_MasterPages_MemberSelected.display = "Dynamic";
ctl00_MasterPages_MemberSelected.validationGroup = "ValidationGroup";

I would like to add attributes to this object, for example:

ctl00_MasterPages_MemberSelected.newAttributeOne = "Attribute1";
ctl00_MasterPages_MemberSelected.newAttributeTwo = "Attribute2";

Does anyone know how this can be done?
 
G

Guest

I found the solution to this which is to use
Page.ClientScript.RegisterExpandoAttribute.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top