【发布时间】:2017-01-31 02:38:59
【问题描述】:
我正在使用一个名为 SexyAlertBox (http://www.coders.me/ejemplos/sexy-alert-box/) 的 jQuery 插件
这是有效的:<input type="button" id="btnHello" onclick="Sexy.alert('Hello!');" />
但我也需要从代码隐藏文件中调用此函数。通常我用这个:
protected void btnError_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "miscript", "alert('This is an alert from a postback!');", true);
}
但无法使用 Sexy.alert 功能。
有什么想法吗? 谢谢。
【问题讨论】:
-
多么愚蠢的插件名称。
-
那么您是否只需要确保首先加载您的插件并将
alert更改为Sexy.alert? -
也许不要使用这个脚本。该网站称该脚本已过时,并且有一个新版本。按照该链接,您将获得商业产品。 jqueryui.com/dialog 怎么样?
标签: c# javascript jquery alert code-behind