獲取用戶輸入我需要讓用戶單擊確定或取消:與CONFIRM
protected void Button1_Click(object sender, EventArgs e)
{
CallRecursive(TreeView1);
string confirmationMessage;
confirmationMessage = @"Please review the data before submitting:" + "\r\n"
+ "Sample Received Date: " + received_dateTextbox.Text + "\r\n"
+ "Site of Ocurrence: " + site_of_occurrenceTextBox.Text + "\r\n"
+ "Occurrence Date: " + occurrence_dateTextBox.Text + "\r\n"
+ "Report Date: " + report_byTextBox.Text + "\r\n"
+ "Specimen ID: " + spec_idTextBox.Text + "\r\n"
+ "Batch ID: " + batch_idTextBox.Text + "\r\n"
+ "Report Initiated By: " + report_byTextBox.Text + "\r\n"
+ "Problem Identified By: " + RadioButtonList1.SelectedValue + "\r\n"
+ nodetexts;
HiddenFieldConfirmation.Value = confirmationMessage;
************i need function ConfirmWithUser() to run here from javascript*************
if (HiddenFieldUserConfirmed.Value != "no")
{
SubmitData();
CallRecursive(TreeView1);
nodetexts += ";";
}
}
這裏是JavaScript:
function ConfirmWithUser() {
if (confirm(document.getElementById('HiddenFieldConfirmation').value) == true)
{ document.getElementById('HiddenFieldUserConfirmed').value='yes'; }
else
{ document.getElementById('HiddenFieldUserConfirmed').value='no';}
我如何在按鈕上點擊運行該功能ConfirmWithUser()
裏面的代碼如上圖所示:
我需要的另一個詞:
- 用戶點擊後按鈕,代碼隱藏的第一部分execeutes
- 的JavaScript代碼隱藏裏面的exeuctes
- 代碼的最後部分之後執行
你不明白HTTP模型。你的設計不可能工作;在客戶端設置值後,您需要單獨回發。 – SLaks
這根本不可能。您需要了解HTTP和客戶端 - 服務器編程。 – SLaks
@slaks你需要有一個chag sameach IMMEDIATELY IMGEDIATELY –