It does makes sense, but will it work for a server side validation
postback?
Cowboy (Gregory A. Beamer) wrote:
> Use delegates to cascade up to the parent form. Then, set a IsValid property
> in the user control. On the parent form test the IsValid property. If not
> valid, do not submit, else, submit the form values.
>
> Overall, it is a "best practice" to have the form control the controls. You
> CAN get away from this if it is the only control on the form. Else, expose
> the properties and let the form pull values to submit. Always validate at
> control level, else you end up with a major mess trying to validate multiple
> user controls.
>
> Hope this makes sense.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> *************************************************
> Think Outside the Box!
> *************************************************
> "jamesd" <> wrote in message
> news: ps.com...
> >I have a user control that has some simple textboxes. The user control
> > is placed into a regular webform with a submit button on it.
> >
> > When the submit button is clicked, the form is posted to the server.
> > The user control contains some code to SERVER SIDE validate one of the
> > textboxes.
> >
> > IF the validation fails, i want the parent web form to know about it,
> > and display a message on the screen.
> >
> > I know this is easy if I use client side validation, but it does not
> > seem to work for server side validation. Any suggestions?
> >
|