Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I tried this code for array value display in js file

JavaScript
function validate()

    {
 
     
for(i=0;i<grd_vb.length;i++)>
{
alert( grd_vb[i]);
 return false;
}
 
  }


I declear the array in codebehind.Below that code is
C#
protected void GridView1_PreRender(object sender, EventArgs e)
    {

        ClientScriptManager cs = Page.ClientScript;



        TextBox lblempid = (TextBox)GridView1.FooterRow.FindControl("lblempid");
cs.RegisterArrayDeclaration("grd_vb", string.Concat("'", lblempid.ClientID, "'"));
}

But i can not able to display the value .any one kindly send the correct code
Thanks
Posted
Updated 13-Mar-12 9:30am
v2
Comments
Prerak Patel 14-Mar-12 0:42am    
When and where do you call validate function?
gokul.net 14-Mar-12 0:49am    
Hi
I need to call the client side validation. i create the separate js file for js coding

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900