MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

override BlogPostEdit  (Mono Support )

Viewed 11085 time(s), 4 post(s) 4/19/2012 5:28:02 AMby David
David

David

4/19/2012 5:31:19 AM
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?



This content has not been rated yet. 
174 Reputation 22 Total posts
khorvat

khorvat

4/19/2012 6:38:01 AM
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
This content has not been rated yet. 
15993 Reputation 2214 Total posts
David

David

4/19/2012 7:52:28 AM

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 = "";
}
This content has not been rated yet. 
174 Reputation 22 Total posts
khorvat

khorvat

4/19/2012 7:43:50 AM
No, that should be it.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts