Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi ,I have a requirement to read the Table content in the page source code. For normal HTML tables and grid view after rendering convert into HTML also i need to find the content. Please suggest me some good links. I need to find the content of the Table in the Text File using C# in Asp.Net.
Thanks in-advance:-)
Posted
Updated 12-May-11 18:07pm
v2
Comments
ZeeroC00l 13-May-11 0:08am    
-- edited for format.

BR//
Harsha
ZeeroC00l 13-May-11 0:09am    
Can you be more specific with your question ?
or Give a clear idea to us as to what you are looking for.
hemantwithu 13-May-11 0:29am    
I have to find the HTML Tables count in the PageSource Code.
fjdiewornncalwe 17-May-11 8:50am    
Exam question, perhaps?

1 solution

I guess you are using webbrowser control, If So this may help you.


use this to get only the content of the table:

HtmlElement he = webBrowser.Document.GetElementById("table-id");
string pagesource = he.InnerHtml;

If you need all the content in the pagesource then use:

HtmlElementCollection hec = webBrowser.Document.All;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900