Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<br />
<pre lang="xml"><ItemTemplate><br />
                               <asp:Label ID="lblname" runat="server" Text='<%# Bind("name") %>'></asp:Label><br />
                           </ItemTemplate></pre><br />
<br />


JavaScript
function fcheck(index) { 
 var index = index;
  $("#gridstudent_lblname_" + index).text("changedata");




}
Posted
Updated 9-Dec-14 23:57pm
v2

1 solution

what about this??
C#
function fcheck(index) {
 var index = index;
 $(this).find("#gridstudent_lblname_"+index).val("changedata");
}
 
Share this answer
 
Comments
SreerangaPrasad sane 10-Dec-14 6:55am    
@/\jmot its not working
Iam calling this script from code behind..
<pre lang="c#">

protected void gridstudent_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridViewRow row = gridstudent.Rows[e.RowIndex];
int index = row.RowIndex;
gridstudent.EditIndex = -1;

ScriptManager.RegisterClientScriptBlock(this, GetType(), "none", string.Format("fcheck('{0}');", index), true);



}

</pre>
/\jmot 10-Dec-14 7:05am    
did you try..
var cbDeclinedID = '<%=gridstudent.FindControl("lblname").ClientID%>';
cbDeclinedID .Val="Your Text"???

See.. Link
SreerangaPrasad sane 10-Dec-14 7:34am    
iam geting this error

Object reference not set to an instance of an object.
/\jmot 10-Dec-14 7:38am    
just think..
the common id for all grid label is like..
gridstudent_lblname_0,gridstudent_lblname_1,gridstudent_lblname_2,gridstudent_lblname_3 etc

so, try use..
document.getelementById("gridstudent_lblname_"+index).Value="Text";
i didn't try this all, just a guess.

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