Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listing controls of a WebForm
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB.NET 1.1
Miscellaneous
Thread ID:
01079556
Message ID:
01080029
Views:
15
This code doesn't help at the point where I am standing right now!

I am using Reflection so I don't have "this". It is exactly what I have trouble with (getting a reference to a webform).


>Here is the code I use to dump to the debug window - it is in C# but it is easily translated:
>
>
>private void DumpControls(Control c, int depth)
>{
>if (c.ID != null)
>{
>for (int a = 1; a < depth; a++)
>{
>Debug.Write("");
>}
>Debug.WriteLine(c.ID, c.ToString());
>}
>foreach (Control subControl in c.Controls)
>{
>DumpControls(subControl, depth + 1);
>}
>
>
>I call it from the page load like so: DumpControls(this.Page, 0);
>
>Let me know if this helps!
>
>
>>Hi
>>
>>I have to create a small tool (a Windows form application) that will :
>>1. open an assembly containing ASP.Net web forms
>>2. list the Web Forms in it
>>3. list the controls in the form (recursively if the control is a container)
>>
>>I have already made a tool like this for Windows forms application.
>>
>>Using Reflection, I have been able to open the assembly and list the Web Forms it contains.
>>
>>I am now jammed on the last topic (listing controls of the selected web form). I cannot use Activator.CreateInstance(tType) like I did with my Windows version of that tool because most classes are abstract.
>>
>>Any one can help on this. An example in VB.Net would be the best but C# would be OK too.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform