Devexpress ASPxDateEdit control OnDateChanged event not firing

无人久伴 提交于 2020-01-04 02:09:20

问题


Below is my Markup page code of the ASPxDateEdit control:

    <dx:ASPxDateEdit 
    ID="txtDateTime" runat="server" Width="100px" EditFormat="Date"
    AllowNull="true" EditFormatString="dd-MMM-yyyy" MinDate="01-Jan-0001" OnDateChanged="txtDateTime_DateChanged"/>

And Here is the code behind of handling the OnDateChanged event

  protected void txtDateTime_DateChanged(object sender, EventArgs e)
{
    //code on handling onDateChanged event
}

My problem is that the OnDateChanged event isn't firing, why this case happens?


I solved this problem yesterday, thanks for everyone's help Answer: What I want to do is a client side event, but what I did is a server side event, so I solved this problem by putting a "AutoPostBack="True"" to it


回答1:


If it is a postback you are trying to achieve set the ASPxDateEdit.AutoPostBack true. The ASPxDateEdit does not postback data automatically.

<dx:ASPxDateEdit 
ID="txtDateTime" runat="server" Width="100px" EditFormat="Date"
AllowNull="true" EditFormatString="dd-MMM-yyyy" MinDate="01-Jan-0001" 

AutoPostBack="True"

OnDateChanged="txtDateTime_DateChanged"/>

If it is a callback (from a callback panel) then you might be trying to change things outside the callback panel, which won't happen as the callback is essentialy an ajax call.

For more info look here. It states that the Event is dependent on the AutoPostBack property.



来源:https://stackoverflow.com/questions/16975577/devexpress-aspxdateedit-control-ondatechanged-event-not-firing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!