I am new in Asp.Net Webforms. In a asp:Imagebutton, when this button is clicked, application has to call a method "VerifyBlankFields" of a asp:View. If everything is ok, it has to show a confirmation screen to user with a date of a field. If user accept it by clicking in Ok button, application has to call another method to finish the process.
In Webforms, I tried to use:
<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.
}
What should I do?