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 )

15277 put(a) pogledan, 4 odgovor(a) 19.4.2012. 5:28:02Kreirao(la) David
David

David

19.4.2012. 5: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?



Ovaj sadržaj još nije ocijenjen. 
174 Reputacija 22 Ukupno objava
khorvat

khorvat

19.4.2012. 6: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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
David

David

19.4.2012. 7: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 = "";
}
Ovaj sadržaj još nije ocijenjen. 
174 Reputacija 22 Ukupno objava
khorvat

khorvat

19.4.2012. 7:43:50
No, that should be it.

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava