Guest User

Untitled

a guest
Aug 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Dynamic table using string builder issue
  2. StringBuilder Builder = new StringBuilder();
  3.  
  4. Builder.Append(@"<table border=1;").Append("id=Tableid;").Append("onclick=GetchildDiv()>").Append("<tr><td>").Append(Mainrow["Title"]).Append("</td></tr></table>");
  5.  
  6. Builder.Append(@"<table border=""1"" ")
  7. .Append("id="Tableid" ")
  8. .Append(""onclick=GetchildDiv();">")
  9. .Append("<tr><td>")
  10. .Append(Mainrow["Title"])
  11. .Append("</td></tr></table>");
  12.  
  13. Builder.Append(@"<table border=""1"" id=""Tableid"" onclick=""GetchildDiv();"">")
  14. Builder.AppendFormat(@"<tr><td>{0}</td></tr></table>", Mainrow["Title"]);
  15.  
  16. Builder
  17. .Append(@"<table border=1 ") // remove semi-colon and add space
  18. .Append("id=Tableid ") // remove semi-colon and add space
  19. .Append("onclick="GetchildDiv();">") // wrap the function-name by "
  20. .Append("<tr><td>")
  21. .Append(Mainrow["Title"])
  22. .Append("</td></tr></table>");
  23.  
  24. System.Text.StringBuilder Builder = new System.Text.StringBuilder();
  25. Builder.Append("<table border="1" ").
  26. Append("id="Tableid" ").
  27. Append("onclick="GetchildDiv()">").
  28. Append("<tr><td>").
  29. Append(Mainrow["Title"]).
  30. Append("</td></tr></table>");
Add Comment
Please, Sign In to add comment