Calling IsValid in a web control

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
S

Simon Harvey

Hi All

Is there anyway to check the IsValid property in a user control?

I've made a user control that holds a number of validators. There are also
event handlers in the control that handle button presses. The problem is
that the IsValid property is defined on the page and isn't available in the
control itself.

Does anyone know how I can find out if the page is valid from inside the
control? I dont want to have to move the event handlers out to the page code
behind

Many thanks all

Simon
 
DujHoD said:
if (Page.IsValid) { ... }

HI,

Thanks for that. I thought it might be that, but given that its a static
method, how does it know what page it's checking without passing anything to
it.

I'm sure that you're right, but I'm not sure how it works

Thanks

Simon
 

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

Back
Top