ASP ButtonのClickイベントでjavascript関数を呼び出そうとしていますが、その関数からModal Popを呼び出すhtmlボタンをクリックしようとしています。ModalPopupを表示するにはModalPopupextenderを使わずにASPボタンをクリックしてください
ステータス:HTMLボタンのクリックイベントをファイルに書き込んで、ModalPopupではなく警告ボックスを実行できます。また、HTMLコードを直接クリックしてModalPopupを開くこともできます。
コード: //コード
protected void Button1_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
RepeaterItem ri = (RepeaterItem)btn.Parent;
Label id = (Label)ri.FindControl("payid");
Add_Account_Head_1.headid_property = id.Text;
update1.Update();
string script = "showpop();";
ScriptManager.RegisterStartupScript(this, GetType(),
"ServerControlScript", script, true);
}
ボディセクションで
$("#btn1").click(function() {
// alert('This has been clicked');
$("#myModal").modal('show');
});
ヘッド部で
function showpop() {
var button = document.getElementById('btn1');
button.click();
};
*ページがちょうど –