c# - Modify Existing HTML Table -
i have html table request webserver in c#. displaying page in aspx webform. how can add prerequisite based on course id last column in table without hard-coding prerequisite? example of table design below.
<tr bgcolor="#e1e1cc"> <td width="7%">003597</td> <td width="5%">01</td> <td width="1%">opt</td> <td width="8%">mt h </td> <td width="16%">2:00 pm - 2:50 pm </td> <td width="17%">08/26/13 - 12/12/13</td> <td width="8%"> <a href="http://www.mnsu.edu/registrar/building.html"target = _blank> <b>tr c124</b> </a> </td> <td width="19%">staff</td> <td width="4%">22</td> <td width="4%">6</td> <td width="4%"><font color="#000000">open</font></td> <td width="7%"> <a href=notes.asp?spclnote=20143+003597+it+100 target = _blank> <b>notes</b> </a> </td> </tr> <tr bgcolor="#e1e1cc"> <td colspan="3"> </td> <td width="8%">m </td> <td width="16%">10:00 - 11:50 am</td> <td width="17%">08/26/13 - 12/09/13</td> <td width="8%"> <a href="http://www.mnsu.edu/registrar/building.html"target = _blank> <b>wh 0119 </b> </a> </td> <td width="19%">staff</td> <td colspan="4"> </td> </tr>
if getting page html string insert html it. like:
private void setvalue(string pagehtml, string id, string texttoinsert) { string html = pagehtml; string smyhtmltoinsert = texttoinsert; int isplitindex = html.indexof(id); isplitindex = html.indexof("{tag}",isplitindex); string shtml1 = html.substring(0, isplitindex); string shtml2 = html.substring(isplitindex); string sfinalhtml = shtml1 + smyhtmltoinsert + shtml2; }
Comments
Post a Comment