ASP.NET User Control Validation ???

T

ticketdirector

I have created a user control containing a drop down list box. I want
to be able to put this user control onto a page along with a validator
control. The problem is, the validator doesn't see the usercontrol as
a "validatable" object. I don not want to include the validator in the
user control because then the type of validator, and its location with
respect to the ddlb, is fixed (unless I do more coding to try and
accomodate all possible configurations, which I don't want to do).

I have tried various ways of making this work over the last 2 days
without success. This seems to me a bit ridiculous that this isn't as
easy as Page.RegisterControlForValidation() or something along those
lines.

Has anyone ever figures out a way around this problem?

Any help is much appreciated.
 
T

tomisarobot

been a while since ive messed with this problem. here are some things
to try.

give your new UserControl a ToString() method.

verify the containing page is actually posting back, UserControl post
back doesnt automatically mean the page is posting back.

if all else fails, you can always manually trigger the page's
validation.
 

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

Top