given an aspx file, I want to parse its controls. I saw other posts on the same topics, but it doesn’t really fit my needs.
Example:
<Ctl:Label id="MyLabel" runat="server" Font-Bold="True">Text of My label</Ctl:Label>
I want to retrieve these informations (the form does not matter, provided that the information are separated):
Tag = "Ctl"
Type = "Label"
id = "MyLabel"
runat = "server"
Font-Bold = "True"
Content = "Text of My label"
This post is close to what I want, but it does not allow me to retrieve “Text of My label” for example.
Note: I don’t need to put this information in a xml file, but why not.
Any idea? Thanks.
EDIT: I need to parse a lot of aspx pages with a desktop program written in C#, not with asp.net.
EDIT 2: Why? Because I have a lot of asp.net pages, that contain server controls that I maintain. I need to retrieve information about in which pages I can find these controls, and most information about them (name, id, what inner controls they eventually have, etc., to say only that), but just focus on the main question, then I will handle the rest.
You may be able to parse the files using the HTML Agility Pack, and then locate the controls by element name.