I have part of an application initialization string below:
<Controls>
<HtmlElement name="lnkLogIn" type="HtmlElement">
<AttributeMatchPath matchtype="equals">
<href>JavaScript:void(0)</href>
<id>s_swepi_22</id>
</AttributeMatchPath>
</HtmlElement>
<InputElement name="tbPassword" type="InputElement">
<AttributeMatchPath matchtype="equals">
<id>s_swepi_2</id>
</AttributeMatchPath>
</InputElement>
<InputElement name="tbUserID" type="InputElement">
<AttributeMatchPath matchtype="equals">
<id>s_swepi_1</id>
</AttributeMatchPath>
</InputElement>
</Controls>
What i want to do in the code behind is a function that gets the Inputelement name and id for each control as key value pairs and returns a dictionary object or something similar from which we can extract the key value pair information.
This is basically being done to remove hardcoding of ID values….so a generic solution to get the elementname and id from the init string and store them as key value pairs would be really great….thanks in advance 🙂
PS: Using C#…..
Ok…Done…. 🙂
here’s what i did: used system.xml.linq functionalities:
Here’s the working code:
}