Devexpress ASPxDateEdit控件OnDateChanged事件未触发 [英] Devexpress ASPxDateEdit control OnDateChanged event not firing

查看:123
本文介绍了Devexpress ASPxDateEdit控件OnDateChanged事件未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的ASPxDateEdit控件的标记页面代码:

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"/>

这是处理OnDateChanged事件的代码

And Here is the code behind of handling the OnDateChanged event

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

我的问题是OnDateChanged事件没有触发,为什么会发生这种情况?

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

我昨天解决了这个问题,感谢大家的帮助
答案:
我想做的是一个客户端事件,但是我所做的是服务器端事件,因此我通过在其上放置了 AutoPostBack = True来解决了这个问题

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

推荐答案

如果它是回发,则尝试实现将ASPxDateEdit.AutoPostBack设置为true。 ASPxDateEdit不会自动回传数据。

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"/>

如果这是回调(来自回调面板),则您可能正在尝试更改回调面板,因为回调本质上是ajax调用,所以不会发生。

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.

有关更多信息,请参见此处。它声明该事件取决于AutoPostBack属性。

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

这篇关于Devexpress ASPxDateEdit控件OnDateChanged事件未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆