2
Answers

gridview textbox validation

Ramya S

Ramya S

8y
379
1
function in javascript: 
function updatealert()
{
var f = document.getElementById('<%=(gvStock.FooterRow.FindControl("txtQnty")).ClientID%>');
if(f.value =='' ")
{
alert("Enter Quantity");
return false;
}
}
gridview template:
 
<asp:Button runat="server" ID="btnUpdate" Text="Update" onkeypress="return validate(event)" OnClick="btnUpdate_Click" OnClientClick="return updatealert()" ForeColor="#003c71"></asp:Button> 
 im getting this error: 
An exception of type 'System.NullReferenceException' occurred in App_Web_ol5f1rt3.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object
 
Answers (2)