我是Asp.Net Webforms的新手。在asp:Imagebutton中,单击此按钮时,应用程序必须调用方法" VerifyBlankFields"一个asp:查看。 如果一切正常,它必须向用户显示一个字段日期的确认屏幕。 如果用户通过单击“确定”按钮接受它,则应用程序必须调用另一种方法来完成该过程。
在Webforms中,我尝试使用:
<asp:ImageButton ID="GenerateProcessBtn" runat="server" ImageUrl="~/img/generateProcess.png"
ToolTip="Generate Process" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
CssClass="icon" TabIndex="2"
OnClick="VerifyFields()"
OnClientClick="if ( ! ConfirDate()) return false;" />
C#
private bool VerifyFields()
{
//Code here
return true; //Just example.
}
public string ConfirmDate()
{
return string.Format("return confirm('Confirm date {0}?');", "01/01/1900"); //--> "01/01/1900" just for test. I have to get the date of a specific field in the asp:View.
}
protected void FinishProcess(object sender, ImageClickEventArgs e)
{
//Code here to finish the process.
}
我该怎么办?