I was looking for some server side validation message which can done without posting back to server. I tried doing javascript and writing that script to literal control and I have been thinking of doing a better way. But here is the cool way to do this.
// Dynamically adding Validation control
RequiredFieldValidator Validator = new RequiredFieldValidator();
Validator.ErrorMessage = "No data to download for your request.";
// Validation group must be specified as to which group you need to bind
Validator.ValidationGroup = "Group1";
Validator.IsValid = false;
Validator.Visible = false;
Page.Form.Controls.Add(Validator);
All you need to do is Depending on your need you need to change message and validation group. We need to set up validation group properly.
Happy coding ![Smile](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-O2a0AsI1jnD0r4swADrXWmdff_242n8vWAeTbD-stBd6vLZ6jcCO2ptEAdFjiCW34hPKXA-7_Wx7bFIHKot3IXLOwbrvSbX5MDqc58EsmWs-K4sgZ0rm_-q7zCgrT9gXtVc2fCghaJqn/?imgmax=800)