Link to home
Create AccountLog in
ASP.NET

ASP.NET

--

Questions

--

Followers

Top Experts

Avatar of rito1
rito1

Findcontrol Within a Gridview Footer template
Ah! Mega Urgent!

I am trying to locate a Label within a footer template of a Gridview and am using the following code to do so but get the error 'Object reference not set to an instance of an object'...

Code-Behind Code within an button OnClick event:

Dim lblRec As Label = GridView1.FindControl("lblRecTonT")


Could anyone kindly advise what I could be doing wrong?

Many thanks

Rit

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of rito1rito1

ASKER

I found the answer, just in case anyone is in the same position as me.. ever :-)

Dim lblRec As Label = GridView1.FooterRow.FindControl("lblRecTonT") - in needs the 'FooterRow'

ASKER CERTIFIED SOLUTION
Avatar of strickddstrickdd🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

ASP.NET

ASP.NET

--

Questions

--

Followers

Top Experts

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications