How to display the Error Message in Asp.Net Page using C#?
<p>I have a couple of dropdown boxex in my aspx page and i have search button also.</p>

<p>if the user clicks the "search" button without selecting any of the dropdown box, i want to display message like "Please select any Value"</p>

<p>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...)</p>

<p>and I want to display the error message from some other .cs file which i am referring in my aspx.cs file.</p>

<p>I have tried like the below: However it is not working.</p>

<pre><code>if (first!= "-- Select The Item --" || second != "-- Select The Item --")
            {
                //Do Something
            }
            else
            {

                throw new Exception("Please select any Filter Type");
            }
</code></pre>
