[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

RE: The IButtonControl interface and validation

Mark

3/28/2007 12:21:00 AM

OK, never-mind I figured this out!

For anyone that may be interested;

If like me you've decided to implement the IButtonControl interface and have
provided the code for all the required properties and events, be careful when
writing a custom control that renders it's own content at the Render stage.

You may need to check your use of the ClientScriptManger >>
GetPostBackEventRefence method when generating the client script for the on
click event of your control's element. Use the constructor which takes an
instance of PostBackOptions and bool value for registerForEventValidation set
to true.

Regards,



"Mark" wrote:

> Hi,
>
> Could some-one provide an example implementation of the CasuesValidation and
> ValidationGroup properties that one should implement when using the
> IButtonControl interface?
>
> I have a custom control which implements this interface and provides the
> required properties but does not fire the client-side validation.
>
> I have also noticed that the necessary client-side field (as would be
> rendered by using the ClientScriptManager >> RegisterForEventValidation) is
> present.
> I must be missing something obvious here.
>
> Regards,
>