Grid View Javascript Validation

To Add Javasvript in Gridview For  Validation
Add Javascript Code in GridView RowDatabound Event
and call tha tfunction From Code

For GridView RowDatabound Add Javascript Code

if (e.Row.RowType == DataControlRowType.DataRow)

TextBox txtRate = (TextBox)e.Row.FindControl(“txtRate”);
txtRate.Attributes.Add(“onblur”, “return ValidateCalculation(‘”+txtRate.ClientID+”‘)”);

And in Aspx Page Add Following Javascript

<script type=”text/javascript”>
function ValidateCalculation(i)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s