我想在按鈕單擊時生成一個警告框。我已經這樣寫了如何從alertbox中獲取OK和CANCEL的值
protected void btn_submit_click(object sender, ImageClickEventArgs e)
{
btn_submit.OnClientClick = @"return confirm('Student has not completed all the steps? Are you sure you want to submit the details?');";
bool type = false;
if(type==true)
{
//If clicks OK button
}
else
{//If clicks CANCEL button
}
}
警報框正確無誤。但是,我怎麼能從代碼中獲取值?請幫助。
if(type- = true)oops這裏是錯誤的,如果(type == true)更正它 – Shadow
爲什麼不使用'ClientScriptMan憤怒' – Nag