gpt4 book ai didi

javascript - 调用按钮单击并显示 ExtNet 确认消息

转载 作者:行者123 更新时间:2023-11-28 06:41:10 26 4
gpt4 key购买 nike

我想使用 ExtNet 确认消息调用按钮单击函数。

起初这是一个正常的按钮,可以正常点击,但现在我们想为其添加条件和确认。必须是外网。

我们想做的是;如果用户单击"is",数据将被保存并且按钮将正常工作。如果点击“否”,则只有按钮起作用

ExtNet确认消息

protected void btnAdd_Click(object sender, EventArgs e)
{

X.Msg.Confirm("Warning", "Message", new JFunction { Fn = "Save" }).Show();
}

和 javascript 部分

var Save = function (btn) {
Ext.Msg.notify("Button Click", "You clicked the " + btn + " button");
}

我知道该消息是 extnet 纪录片上的示例。使用它来查看它是否有效。

和按钮

protected void btnAdd_Click(object sender, EventArgs e)
{
//it's assignments and other functions.
}

我只是不知道如何触发按钮点击功能。我遇到了一些类似的问题,但它们没有帮助,而且我没有 Ajax 经验。

最佳答案

如果您想使用 ext.net 从 javascript 调用 C# 事件,您可以使用他们所谓的 DirectEvents,请从他们的网站查看此示例:

http://examples.ext.net/#/Events/DirectEvents/Overview/

“添加 DirectEvent 并确认 ”正是您所需要的。

关于javascript - 调用按钮单击并显示 ExtNet 确认消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33806702/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com