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 15802 time(s), 4 post(s) 19.04.2012 05:28:02by David
David

David

19.04.2012 05:31:19
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?



Dieser Inhalt wurde noch nicht bewertet. 
174 Reputation 22 Total posts
khorvat

khorvat

19.04.2012 06:38:01
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
Dieser Inhalt wurde noch nicht bewertet. 
15993 Reputation 2214 Total posts
David

David

19.04.2012 07:52:28

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 = "";
}
Dieser Inhalt wurde noch nicht bewertet. 
174 Reputation 22 Total posts
khorvat

khorvat

19.04.2012 07:43:50
No, that should be it.

Regards
Dieser Inhalt wurde noch nicht bewertet. 
15993 Reputation 2214 Total posts