Why would this code work
<dx:ASPxButton ID="btnAbbrechen" runat="server" AutoPostBack="False" Text="Abbrechen"
EnableClientSideAPI="True" ClientSideEvents-Click='<%# KundenAuswahlAbbrechenClickHandler() %>'>
</dx:ASPxButton>
And this one not:
<dx:ASPxButton ID="btnAbbrechen" runat="server" AutoPostBack="False" Text="Abbrechen"
EnableClientSideAPI="True">
<ClientSideEvents Click='<%# KundenAuswahlAbbrechenClickHandler() %>' />
</dx:ASPxButton>
?
The second throws an error: Databinding expressions are only supported on objects that have a DataBinding event. AspxButton does not have a DataBinding event.
I know how to handle the code right, I just want to know why the second option won't work? I always thought that it is just another way of setting properties for a WebControl?!
Thanks
Stefan
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Stefan,
The ClientSideEvents object is not inherited from the control that supports the DataBinding event. It is a settings property that is used to register client-side events.
However, when you use the ClientSideEvents-Click property, the ASP.NET framework sees that you are using a data-binding expression in the context of the ASPxButton control (that has the mentioned event).
That is why data-binding works fine.
You can also examine another approach of runtime event handler initialization. Please check our KB article: The general technique of using the Init/Load event handler.
Thanks,
Vest