Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to find out the data between the ttwo div tags of html source how van i acheive this..


I want the following part from the total html source.

XML
<div class="important-dates domain-data">
<header>
<!-- span title="We are still waiting for this data to be fetched." rel="tooltip" class="fetch-waiting"></span -->
<span title="This data has been fetched." rel="tooltip" class="fetch-success" style="display:block"></span>
<!-- span title="We were unable to fetch this data." rel="tooltip" class="fetch-fail"></span -->
<h5>Important Dates
<a class="btn tiny pjax-btn" href="/domain-history/sunlightit.com">More Info</a></h5>
</header>

<table>
<tbody>
    <tr>
<th>Expires On</th>
<td><span data-bind-domain="expiration_date" style="visibility: visible;">September 20, 2013</span></td>
</tr>
        <tr>
<th>Registered On</th>
<td><span data-bind-domain="expiration_date" style="visibility: visible;">September 20, 2006</span></td>
</tr>
        <tr>
<th>Updated On</th>
<td><span data-bind-domain="expiration_date" style="visibility: visible;">November 03, 2012</span></td>
</tr>
    </tbody></table>
</div>



how can i acheive this.

pls help me .......
thanks in advance.....
Posted
Comments
kk2014 18-May-13 7:21am    
u mean to say u want data between <div class="important-dates domain-data"> and </div> from code behind. right?
[no name] 18-May-13 8:24am    
yes yes i want the data between the two <div></div>tags

Declare id of your div and then set runat property of your div to "server" as below.
ASP.NET
<div id="myDiv" class="important-dates domain-data" runat="server"></div>

Then access inner HTML of your div as below.
C#
string sHTML= myDiv.InnerHtml;
 
Share this answer
 
Comments
[no name] 18-May-13 8:28am    
i got total html source from another site.now i want that part only................how?
If I got it right, you fetch the html code from somewhere - not your code is emitting it. And you want to extract a portion from it. Than try HTML Agility Pack library[^]
 
Share this answer
 
v2
Comments
[no name] 18-May-13 8:25am    
yes u are correct i got total html code from somewhere else.now i want that above portion..
Zoltán Zörgő 18-May-13 14:01pm    
Good. Have you taken a look at the agility pack?
asign runate="server" and id="name"
 
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