Raghvendr Singh

Raghvendr Singh

  • NA
  • 117
  • 127.7k

Data grid Footer Control

Jan 22 2011 5:44 AM

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.

Answers (2)