Stop Postback from MCMS Custom SingleImagePlaceHolder
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Stop Postback from MCMS Custom SingleImagePlaceHolder




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Stop Postback from MCMS Custom SingleImagePlaceHolder  
twright1


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-11-07 12:15 AM

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 placeholde
r
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 ]



    Re: Stop Postback from MCMS Custom SingleImagePlaceHolder  
Stefan Goßner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:58 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register