I have a web page which inherits from another page called Basepage.
In the Base page class I want to get reference of any gridview which is in
derived page. How to do that?
Thanks
If you have fields defined for them on the base page, using
CodeFileBaseClass attribute helps.
http://aspadvice.com/blogs/joteke/archive/2006/03/08/15655.aspx
Otherwise, using FindControl etc of course works.

Signature
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
>I have a web page which inherits from another page called Basepage.
> In the Base page class I want to get reference of any gridview which is in
> derived page. How to do that?
>
> Thanks
Vikram - 10 Jul 2007 13:34 GMT
No I don not have fields defined on the base page. I did findcontrol but i
did not get any control.
Please let me know in more details.
> If you have fields defined for them on the base page, using
> CodeFileBaseClass attribute helps.
[quoted text clipped - 7 lines]
> >
> > Thanks
Teemu Keiski - 10 Jul 2007 14:01 GMT
Post some code to demonstrate. Using FindControl should work, but of course
you must have protective logic in case separate subpages have different
kinds of controls you all query for.
Teemu
> No I don not have fields defined on the base page. I did findcontrol but i
> did not get any control.
[quoted text clipped - 12 lines]
>> >
>> > Thanks