I have a couple of dropdown boxex in my aspx page and i have search button also.
if the user clicks the "search" button without selecting any of the dropdown box, i want to display message like "Please select any Value"
My Page is created dynamically, all the controls are dynamically created. and i dont want to display the error message using any of the static aspx page controls like (Text Box, label or etc...)
and I want to display the error message from some other .cs file which i am referring in my aspx.cs file.
I have tried like the below: However it is not working.
if (first!= "-- Select The Item --" || second != "-- Select The Item --")
{
//Do Something
}
else
{
throw new Exception("Please select any Filter Type");
}