Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Finding a control inside of a content piece of a master page.

Reply
Thread Tools

Finding a control inside of a content piece of a master page.

 
 
Mufasa
Guest
Posts: n/a
 
      08-21-2008
So how can I find a control that is in the content section of a master page.

Essentially I want to do a search of all controls on the page. If they are
child of another control I want to include that in my search so I don't have
to keep drilling down through each of the objects.

TIA - Jeff.


 
Reply With Quote
 
 
 
 
Frederik Van Lierde
Guest
Posts: n/a
 
      08-22-2008
Use Reflection.

using System.Refelction;
.....
// Somewhere in the code where you need to search

FieldInfo[] _listControls =
_object.GetType().GetFields(BindingFlags.FlattenHi erarchy |
BindingFlags.Instance | BindingFlags.NonPublic))

// Then search in the Array.



It is important to have BindingFlags.FlattenHierarchy

I hope this brings you into the right direction

Frederik Van Lierde
http://www.SilverSandsAssociates.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control inside content page to access Master Page Vars Poofactory ASP .Net 2 04-19-2008 06:46 AM
word content inside asp.net master / content pages jobs ASP .Net 1 12-13-2006 05:10 PM
Download a file piece by piece Patrick Plattes Ruby 2 11-30-2006 07:48 PM
Finding the leftmost pixel in a piece of text when using GDI+ Nathan Sokalski ASP .Net 3 06-29-2005 09:19 AM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM



Advertisments