C# .NET - how to read duplicate Ids in a html Document using ASp.Net C#

Asked By sasi on 29-May-13 06:43 AM

I Need to Develop an http://asp.net/ page that reads html files  in a folder and displays list of duplicate ids. ie. Same id used with-in one or more html files


          <div id=”a1”> </div> <ul id=”a2”> <li> Hello </li> <li> how are you</li></ul>


          <ul id=”a1></ul> <div id=”a3”> <ul> <li> Val 1</li><li>Val2</li> </ul></div>


The program should display the following result:


                  ID        Files

                  A1       a.html, b.html Any one help me Please. Thanks in Advance.

Ramendra Kumar replied to sasi on 30-May-13 06:20 AM
For this you need to do via File handler read the files content and if fount id then find next " then started reading in another variable and then split with " like id="ramendra"
now you have rame ndra store in a global array
now mathc this id in all of your files and do whatever you wish.
happy coding