S
Søren Reinke
Hi there
I am trying to create the following server control.
My control has 3 stages, where it show 1 of 3 images, as parameter is gets
1-3 ID's of validators on the aspx page.
States:
1. No required validators, show an empty image
2. One or more validator was invalid, show a red arrow image
3. All validators are valid show green arrow image.
(the control just returns '<img src="red.gif" />'
My problem is, in the aspx page i have:
<cc1:ValidationPicture ID="ValidationPicture1" runat="server"
Validator1="cityRequiredFieldValidator"
Validator2="cityRegularExpressionValidator"/>
My method in the DLL get's called correctly, but how do i get from the ID af
a validator 'cityRegularExpressionValidator' to the object ? So i can call
'isValid()' on it ?
I tried with:
obj=Page.FindControl(ID)
and
obj=FindControl(ID)
Put the first one fails because 'Page' is null/nothing the other one always
returns null/nothing.
I have tried to google it, but no luck
How do the validators do it ? The
also just get an ID and evaluate the objects content.
Please help me, an example would be nice, if does not matter if it is in VB
or C#
--
Best regards C.T.O. Søren Reinke
www.Xray-Mag.com/ - Your free diving magazin on the net. Download it in PDF
BALI :: Polluce Wreck: A tale of treasures lost and found. SALT
(mini-theme):
The Salty Oceans - Survive on Seawater? - Mangroves
I am trying to create the following server control.
My control has 3 stages, where it show 1 of 3 images, as parameter is gets
1-3 ID's of validators on the aspx page.
States:
1. No required validators, show an empty image
2. One or more validator was invalid, show a red arrow image
3. All validators are valid show green arrow image.
(the control just returns '<img src="red.gif" />'
My problem is, in the aspx page i have:
<cc1:ValidationPicture ID="ValidationPicture1" runat="server"
Validator1="cityRequiredFieldValidator"
Validator2="cityRegularExpressionValidator"/>
My method in the DLL get's called correctly, but how do i get from the ID af
a validator 'cityRegularExpressionValidator' to the object ? So i can call
'isValid()' on it ?
I tried with:
obj=Page.FindControl(ID)
and
obj=FindControl(ID)
Put the first one fails because 'Page' is null/nothing the other one always
returns null/nothing.
I have tried to google it, but no luck
also just get an ID and evaluate the objects content.
Please help me, an example would be nice, if does not matter if it is in VB
or C#
--
Best regards C.T.O. Søren Reinke
www.Xray-Mag.com/ - Your free diving magazin on the net. Download it in PDF
BALI :: Polluce Wreck: A tale of treasures lost and found. SALT
(mini-theme):
The Salty Oceans - Survive on Seawater? - Mangroves