d.GetType().GetProperty("value2").GetValue(d, null);
Run Code Online (Sandbox Code Playgroud)
这将返回d中value2属性的值.
我想要value2中的属性值,即d.value2.value3.
我该怎么做到这一点?
我有以下对javascript的调用:
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
this._BtAdd.Attributes.Add("onclick", "GXDualListBox_MoveDualList(" + sourceListId + ", " + destListId + ", " + selectedValuesId + ", false, true, "+ this._SortByDescription +");");
this._BtRemove.Attributes.Add("onclick", "GXDualListBox_MoveDualList(" + destListId + ", " + sourceListId + ", " + selectedValuesId + ", false, false, " + this._SortByDescription + ");");
if (!this._PostBackOnAll)
{
this._BtAddAll.Attributes.Add("onclick", "GXDualListBox_MoveDualList(" + sourceListId + ", " + destListId + ", " + selectedValuesId + ", true, true, " + this._SortByDescription + " );");
this._BtRemoveAll.Attributes.Add("onclick", …Run Code Online (Sandbox Code Playgroud) 这是我第一次尝试使用 JQuery/Ajax。我有一个 RadDatePicker,在选择日期时,日期保存在数据库中,用户应该收到一条消息,说明日期已保存。RadDatePicker 在其事件 OnDateSelected 上调用一个函数,如下所示(C#):
radDatePicker.ClientEvents.OnDateSelected = "function(sender, args){SaveDate(sender,args," + PriceDealProposalId + ")}";
Run Code Online (Sandbox Code Playgroud)
javascript 函数 SaveDate 成功调用网络服务来保存所选日期。
function SaveDate(sender, e, id) {
if (e.get_newDate() != null) {
$.ajax({
url: "/ajaxservice.asmx/SaveSignedDate",
data: "{priceDealProposalId:" + id + ",proposalDate: " + JSON.stringify(e.get_newDate()) + "}",
dataType: "json",
type: "POST",
contentType: "application/json;charset=utf-8",
success: function (data) {
alert("saved");
}
});
}
}
Run Code Online (Sandbox Code Playgroud)
以上成功保存值并提示消息。我想在此 RadDatePicker 控件附近显示一条文本消息,而不是警报,该消息显示“已保存”并在几秒钟内消失。我不确定如何解释此成功消息并显示文本。请帮我。