# \[4.3.0\] DotVVM.Framework.Compilation.DotvvmCompilationException: Content control must inherit from DotvvmControl, but DotVVM.Framework.Controls.ConfirmPostBackHandler doesn't

**URL:** <https://forum.dotvvm.com/t/4-3-0-dotvvm-framework-compilation-dotvvmcompilationexception-content-control-must-inherit-from-dotvvmcontrol-but-dotvvm-framework-controls-confirmpostbackhandler-doesnt/273>\
**Category:** Discussion in English\
**Tags:** webforms\
**Created:** [October 23, 2024, 12:55pm UTC](https://forum.dotvvm.com/t/4-3-0-dotvvm-framework-compilation-dotvvmcompilationexception-content-control-must-inherit-from-dotvvmcontrol-but-dotvvm-framework-controls-confirmpostbackhandler-doesnt/273 "2024-10-23T12:55:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Twoleeland](https://forum.dotvvm.com/user_avatar/forum.dotvvm.com/twoleeland/32/381_2.png) [@Twoleeland](https://forum.dotvvm.com/u/Twoleeland)\
**Post date:** [October 23, 2024, 12:55pm UTC](https://forum.dotvvm.com/t/4-3-0-dotvvm-framework-compilation-dotvvmcompilationexception-content-control-must-inherit-from-dotvvmcontrol-but-dotvvm-framework-controls-confirmpostbackhandler-doesnt/273/1 "2024-10-23T12:55:15Z")

</div>

When I add this simple part to a repeater control, all is good, no compilation error:

```auto
<PostBack.Handlers>
    <dot:ConfirmPostBackHandler Message="Do you really want to submit the form?" />
</PostBack.Handlers>

```

But adding the same to a `<dot:Button>`, as shown in many examples, I get the error:  
DotVVM.Framework.Compilation.DotvvmCompilationException: Content control must inherit from DotvvmControl, but DotVVM.Framework.Controls.ConfirmPostBackHandler doesn’t.

Do I miss something?!

Here is the full button control code I use in the page:

```auto
<dot:Button ButtonTagName="button" class="btn btn-icon p-0"
            title="{resource: SomeStringProperty}"
            IncludeInPage="{resource: SomeBooleanProperty}"
            Click="{command: SomeCommand()}">
    <ItemTemplate>
        <i class="flag flag-country-ch"></i>
    </ItemTemplate>
    <PostBack.Handlers>
        <dot:ConfirmPostBackHandler Message="Do you really want to submit the form?" />
    </PostBack.Handlers>
</dot:Button>

```

Best regards

---

<div class="post-metadata">

**Author:** ![exyi](https://forum.dotvvm.com/user_avatar/forum.dotvvm.com/exyi/32/9_2.png) [@exyi](https://forum.dotvvm.com/u/exyi)\
**Post date:** [October 23, 2024, 9:10pm UTC](https://forum.dotvvm.com/t/4-3-0-dotvvm-framework-compilation-dotvvmcompilationexception-content-control-must-inherit-from-dotvvmcontrol-but-dotvvm-framework-controls-confirmpostbackhandler-doesnt/273/2 "2024-10-23T21:10:56Z")

</div>

Sorry, this is a bit confusing, but you just have to unwrap the `<ItemTemplate>`, and place `PostBack.Handlers` first.

Button has no ItemTemplate, you just place content inside it. DotVVM thus treats the `<ItemTemplate>` element as a classic HTML element (you’ll see it in the output). Since content must be after all _element properties_, the `<PostBack.Handlers>` is not treated as property either.

---

<div class="post-metadata">

**Author:** ![Twoleeland](https://forum.dotvvm.com/user_avatar/forum.dotvvm.com/twoleeland/32/381_2.png) [@Twoleeland](https://forum.dotvvm.com/u/Twoleeland)\
**Post date:** [October 24, 2024, 8:48am UTC](https://forum.dotvvm.com/t/4-3-0-dotvvm-framework-compilation-dotvvmcompilationexception-content-control-must-inherit-from-dotvvmcontrol-but-dotvvm-framework-controls-confirmpostbackhandler-doesnt/273/3 "2024-10-24T08:48:00Z")

</div>

Thanks a lot for your reply!

Now it works. 😉

One thing I noticed in the browser console when I used this handler and clicked “Abort”:

 ![browser console error when clicking "Abort"](https://forum.dotvvm.com/uploads/default/original/1X/755d7167d3d3522e8dd61dc1263d2ccb5faa2007.png)

I think this shouldn’t happen, because it’s the decision of the “user” to abort the confirm and not a real error of the framework doing something wrong.

And two other things I would like to mention:

1. Your answer should be added to the docs because it’s essential on how to place the handlers within a button control along with the content.
2. A prominent link to this forum is missing in the docs. It’s hard for “new” users to find where they can get additional help. 😉

Best regards
