Hi
Rajesh,
I assumed:
Button Name: btnSave
Textbox Name: txtAdd
Server side code:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
btnSave..Attributes.Add("onclick","return checkValidation();");
}
}
Javascript code:
function checkValidation()
{
var txt = document.getElementById('<%= txtAddlientID %>');
if(txt.value == '')
{
alert('Please enter data before save!');
return false;
}
return true;
}
Please do let me know, if you have any doubt.
Please provide "
Vote":thumbsup: if this would be helpful, and make "
Accept Answer" if this would be correct answer.:rose:
Thanks,
Imdadhusen