Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am unable to find the value below is my aspx code

//design code
XML
<asp:CommandField ShowEditButton="True"  ControlStyle-CssClass="control"
                ControlStyle-ForeColor="#3366FF">
<ControlStyle CssClass="control" ForeColor="#3366FF"></ControlStyle>
            </asp:CommandField>


ASP.NET
<ItemTemplate >           
            <asp:Label ID="lblstaff" runat="server" Text='<%#Bind("Staff") %>'></asp:Label>
            
            </ItemTemplate>



//cs code
C#
 protected void  // ERROR: Handles clauses are not supported in C#
    GridView1_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Edit")
            {
                Control ctrl = e.CommandSource as Control;
                if (ctrl != null)
                {
                    GridViewRow row = ctrl.Parent.NamingContainer as GridViewRow;
                    //LinkButton fullname = (LinkButton)row.FindControl("lbName");
                    Label lblAssaignedto = (Label)row.FindControl("lblstaff");
                }
                
            }
}



//my problem is i am unable to find the label value....
Posted
Updated 15-May-13 4:07am
v3
Comments
Mohammed Hameed 15-May-13 10:05am    
Check the label spelling lblstaff is correct?
ntitish 15-May-13 10:07am    
correct only sir.
ZurdoDev 15-May-13 10:19am    
You need to reply to the comment instead of adding a new comment to your own question. Then the user who made the comment will be notified.
ntitish 15-May-13 10:32am    
Sorry...Can u send me the modified code.

ZurdoDev 15-May-13 10:19am    
Can't you just do e.Row.FindControl("lblstaff") ?

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