public void ShowAlert()
{
string value = "9494949494";
string message = "alert on " + value;
string script = "alert('" + message + "');";
string script2 = "alert('" + message + "');";
var myScripts = new List<String>();
myScripts.AddRange(script, script2);
foreach(var s in myScripts)
{
ScriptManager.RegisterStartupScript(this, typeof(Page),
"UserSecurity", s, true);
}
}
を表示する方法を助けることができる:
以上の合理的なアプローチ
public void ShowAlert()
{
string value = "9494949494";
string message = "alert on " + value;
string script = "alert('" + message + "');";
string script2 = "alert('" + message + "');";
var myScripts = script + script2
ScriptManager.RegisterStartupScript(this, typeof(Page),
"UserSecurity", myScripts, true);
}
コードがあるの?次々に2つの警告文を入れようとしましたか?それは動作しましたか?それは何を示しましたか?エラーはありますか? –
上記のコードでは、アラートを取得するために使用していますが、1つ後に1つを表示するために使用しています... – Basha
スクリプトでは、2つのアラート・ステートメントを次々に入れることができます。 –