I am doing something like below on a web forms application;
protected void button_transfer_search_Click(object sender, EventArgs e) {
Page.Validate("val1");
if (!Page.IsValid && int.Parse(txtArrivalDateTrf.Text) + 5 < 10) {
return;
}
also, I have following code on my aspx file;
<div class="search-engine-validation-summary">
<asp:ValidationSummary ValidationGroup="transfer" runat="server" ShowMessageBox="false" />
</div>
my question is how to add an error message to the page before return so that validation summary can grab that and displays it. I know we can do this in mvc easily but I haven't figured out how to do that in web forms. thanks !