0
如何讓JavaScript彈出窗口顯示一個字符串?我宣佈一個字符串:我想要一個腳本來顯示我已經聲明的字符串
string myString;
myString = "hello world!";
protected void Button1_Click(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message",
"window.alert('myString');", true);
}
但它顯示myString
而不是hello world!
是` `UpdatePanel`內的button1`?如果是這種情況,您需要改爲使用`updatePanel.GetType()`方法。 – BrunoLM 2011-02-07 09:47:50