ASP.NET
--
Questions
--
Followers
Top Experts
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("lbl RecTonT")
Could anyone kindly advise what I could be doing wrong?
Many thanks
Rit
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("lbl
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.
I found the answer, just in case anyone is in the same position as me.. ever :-)
Dim lblRec As Label = GridView1.FooterRow.FindCo ntrol("lbl RecTonT") - in needs the 'FooterRow'
Dim lblRec As Label = GridView1.FooterRow.FindCo
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
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