Hi
I have some linkButtons in FooterTemplete I want to get text of LinkButton control in a string.My code is as :
System.Web.UI.WebControls.LinkButton btn = new System.Web.UI.WebControls.LinkButton();
btn = (System.Web.UI.WebControls.LinkButton)GridView1.FindControl("LinkButton01");
string s = btn.Text;
My problem is that this code returning null value in btn variable.So it providing error 'Object reference not set to an instance of an object.' on the line
string s = btn.Text;
I am unable to sort this problem please help me.
Data grid Footer Control
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Dorababu MekaRank #457 · 5.5K reputationPosted Jan 22, 2011, 1:21 AM EST
Raghvendr Singh81 reputationPosted Jan 23, 2011, 6:53 PM EST
I have exactly copy and past the id(LinkButton01) from html.