12-12-07 12:25 PM
Hi,
this issue is covered in chapter 9 of the following book which covers
placeholder validation in detail:
http://tinyurl.com/8ugwj
Cheers,
Stefan
"twright1" <twright1@discussions.microsoft.com> wrote in message
news:04FC379D-6148-4113-A67A-4B2499546FCA@microsoft.com...
>I have a custom SingleImagePlaceholder that checks the image size and
>width.
> If the dimensions are incorrect it sets the sizevalidtor and
> widthvalidator
> controls to false and with the OnSavingContent method cancels the
> placeholder
> save.
>
> The problem is even though the validation controls have been set to false
> the page still does a postback to the server. However, I noticed if I go
> edit an existing posting and click the save dialog the validators work,
> the
> error message is displayed and the submit is stopped. On Save and Exit it
> does not work.
>
> Is there a way to stop the submit? If so, what method should I add it to?
>
> I have included code from my custom control.
>
>
>
>
>
>
>
>
>
>
>
> protected override void OnSavingContent(PlaceholderControlSaving
EventArgs
> e)
> {
> if (this.AuthoringChildControlsAreAvailable)
> {
> EnsureChildControls();
> if (!IsImageValid())
> {
> e.Cancel = true;
> }
> else
> {
> base.OnSavingContent(e);
> }
> }
> }
[ Post a follow-up to this message ]
|