Call page method from user control in C#?

  • Thread starter Thread starter Tulio Quinones
  • Start date Start date
T

Tulio Quinones

I have a menu user control that navigates through 4 or 5 web forms. The
control basically has "tabs" that are hyperlinks to each page.

On each page a have a validation method that validates all page input.

How can I call this method from the user control when the a tab/hyperlink is
selected?

Do I create a delegate on web form? If so, any pointers. Is there an
easier way?

Regards,

Tulio
 
Tulio Quinones said:
I have a menu user control that navigates through 4 or 5 web forms. The
control basically has "tabs" that are hyperlinks to each page.

On each page a have a validation method that validates all page input.

How can I call this method from the user control when the a tab/hyperlink is
selected?

Do I create a delegate on web form? If so, any pointers. Is there an
easier way?

Would Page.Validate suit your needs?
 
Look up IPostBackEventHandler in the framework documentation. The
documentation shows how to implement the interface and create an event in
your control.

Then, in the web form, create an event handler for your custom event, and
from that event handler, call your validation method. It's really easier
than it sounds.

Good luck,

Dale Preston
MCAD, MCSE, MCDBA
 
Back
Top