Generate Html from VB.net

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2007
Posts: 1
Reputation: stumaca is an unknown quantity at this point 
Solved Threads: 0
stumaca stumaca is offline Offline
Newbie Poster

Generate Html from VB.net

 
0
  #1
Apr 28th, 2007
Gidday I have a single Array of items (total number of items in array would be variable) that i want to display in a table like format i.e.
  1. <table>
  2. <tr>
  3. <td>ArrayVar[0]</td>
  4. <td>ArrayVar[1]</</td>
  5. </tr>
  6. <tr>
  7. <td>ArrayVar[2]</</td>
  8. <td>ArrayVar[3]</</td>
etc...
or
  1. <div style="float:left">ArrayVar[0]</div>
  2. <div style="float:left">ArrayVar[1]</div>
etc...
How can I generate this in VB.net with say a loop I know there was something in .NET 1.1 that could do this & can't find anything for 2.0
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 143
Reputation: cutepinkbunnies is an unknown quantity at this point 
Solved Threads: 8
cutepinkbunnies's Avatar
cutepinkbunnies cutepinkbunnies is offline Offline
Junior Poster

Re: Generate Html from VB.net

 
0
  #2
Apr 28th, 2007
Stumaca,

www.asp.net

Check out their tutorials, I'm sure you'll be able to figure it out from there. Their tutorials are excellent for someone starting with ASP.

Jon
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 275
Reputation: f1 fan is an unknown quantity at this point 
Solved Threads: 11
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Generate Html from VB.net

 
0
  #3
May 2nd, 2007
use a string builder if you want to make it yourself.

  1. stringbuilder sb = new stringbuilder;
  2. sb.appendline("<table>");
  3. for (int i=0; i<=arraycount; i+=2) //for vb people it is For I = 0 to arraycount Step 2)
  4. {
  5. sb.appendline("<tr>");
  6. sb.append("<td>");
  7. sb.append(arrayvar[i]);
  8. sb.appendline("</td>");
  9. sb.append("<td>");
  10. sb.append(arrayvar[i+1]);
  11. sb.appendline("</td>");
  12. sb.appendline("</tr>");
  13. }
  14. sb.appendline("</table>");
  15. //now put it on the page - probably using a literal
  16. literal1.text = sb.tostring();

or you could use an html writer but this works just as well.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 6658 | Replies: 2
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC