Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access Control inside GridView Pager Template - ASP.NET

I am trying to access a LinkButton that is inside a PagerTemplate in a GridView.

However, I am getting a NullReferenceException and I don't know what I am doing wrong here.

I have tried the following...

((LinkButton)GridView1.BottomPagerRow.FindControl("lnkbtnPrevious"));
((LinkButton)GridView1.FindControl("lnkbtnPrevious"));

Can someone please help?

Thanks!

like image 619
NullReference Avatar asked Oct 16 '25 11:10

NullReference


1 Answers

GridViewRow PagerRow = GridView1.BottomPagerRow;
LinkButton b = (LinkButton)PagerRow.FindControl("lnkbtnPrevious"));
like image 56
sujit kumar m Avatar answered Oct 18 '25 02:10

sujit kumar m



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!