Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gridview dynamic controls on Masterpage

Status
Not open for further replies.

Gruuka

Programmer
Aug 27, 2006
24
0
0
NL
Hey everyone, i created a masterpage and linked a page that has a gridview linked to a contentplace holder on that master page, now this is working.

But there is a problem with controls when i cast a object as control that excists in the gridview to a textbox by using FindControl on Me.Master.Page (also tried Me.Master and EditSpec.findcontrol (edit spec is the gridview)) i will get an error concerning a nullreference exception because that control was not found on the masterpage.

I have the same code working but it isn't in the masterpage.

 
Try exposing the relevant control via a Public Property in the Master Page. Any child pages can then just call that property.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Sorry but I don't understand that part, the controls I have on the gridview are all dynamicly created on page_init so setting those as public prop on the masterpage would be somewhat impossible? (unless I am mistaken ofcourse).
 
A public property can expose anything from the page. If you can find them actually in the Master Page code, then you can return them to any calling Page.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I notice that you have posted some questions and don't reglarly respond or thank the person that helped you. Please read this FAQ: faq401-2552
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top