Mono Support override BlogPostEdit 

Viewed 15501 time(s), 4 post(s), 4/19/2012 5:28:02 AM - by David
4/19/2012 5:31:19 AM
174 Reputation 22 Total posts

I am looking to write some code that takes place after the "publish" button is clicked on the BlogPostEdit control.

<MonoX:StyledButton id="btnSave" runat="server" CausesValidation="true"
OnClick="btnSave_Click"  />

To do this I was looking to override like the following but this does not work.

01.namespace ProjectName.Web.CustomClasses
02.{
03.    public partial class BlogPostEditOverride : MonoSoftware.MonoX.ModuleGallery.Blog.BlogPostEdit
04.    {
05.        public override void btnSave_Click()
06.        {
07.            base.btnSave_Click();
08.        }
09.    }
10.}


What would you suggest in order for me to do as I suggested?



1
4/19/2012 6:38:01 AM
15993 Reputation 2214 Total posts

Hi,

you should have a BlogPostSaved event on the BlogPostEdit control and you can attach to that event.

Let me know if you need anything else.

Regards

2
4/19/2012 7:52:28 AM
174 Reputation 22 Total posts

Thank you for getting me in the right direction. This seems to work. Would you suggest something different?

public BlogPostEditOverride() : base()
{
    base.BlogPostSaved += new EventHandler(BlogPostEditOverride_BlogPostSaved);
}
 
void BlogPostEditOverride_BlogPostSaved(object sender, EventArgs e)
{
    string test = "";
}

3
4/19/2012 7:43:50 AM
15993 Reputation 2214 Total posts

No, that should be it.

Regards

4
This is a demo site for MonoX. Please visit Mono Software for more info.