问题描述
我有一个来自 DexExpress 的 DateEdit 控件,需要使用 Javascript 从中获取日期值.从概念上讲,我正在寻找这样的东西:
I have a DateEdit control from DexExpress and need to get the date value from it using Javascript. Conceptually, I am looking for something like this:
var d = $("dpEndDate").GetDate();
他们的 API 参考表明 .GetDate() 是一个成员,但我只需要知道如何获取包含该成员的对象的客户端实例.
Their API reference indicates that .GetDate() is a member, but I just need to know how to acquire a client-side instance of the object that contains this member.
推荐答案
需要指定 ClientInstanceName 属性(对于 ASP.NET WebForms)和Name"属性(对于 ASP.NET MVC)以启用控件的客户端编程对象:
It is necessary to specify the ClientInstanceName property (for the ASP.NET WebForms) and the "Name" property (for the ASP.NET MVC) to enable control’s client-side programmatic object:
<dx:ASPxDateEdit ... ClientInstanceName="de">
</dx:ASPxDateEdit>
var date = de.GetDate();
这篇关于DevExpress:如何获取控件客户端的实例并访问其客户端成员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!