2
Answers

C# code for Tabular list

Photo of Abhijit P

Abhijit P

15y
4.2k
1

I need to convert a list into tabular format. I tried using normal HTML code but didnt work. I need 2 cols. in the table. This is a aspx.cs file.
Please help me with this as i am a newbie.
The list code is given below:
 
 private void AddCategoryToMenu(string title)
 {
  HtmlAnchor a = new HtmlAnchor();
  a.InnerHtml = Server.HtmlEncode(" " + title) + "<BR>";
  a.HRef = "#" + Utils.RemoveIllegalCharacters(title);
  a.Attributes.Add("rel", "directory");
  HtmlGenericControl li = new HtmlGenericControl("img align=middle src=images/icons/" + title );
  li.Controls.Add(a);
  ulMenu.Controls.Add(li);
 }

Answers (2)

0
Photo of Brandon Lewis
NA 603 116k 17y
I might be wrong, but I think its because you can't read XML from a URL. Maybe your mistaking XML for XHTML, which is eXtensibile HyperText Markup Language and its what 90% of web pages are built on these days unless you get into PHP or JavaScript and what not.
XML I believe is used primarily for web data storage on a user's PC and for small and simple database-like needs, it can be read by a web page, but is not an actual part of the build source code. Then again, I could be wrong but in all my web designing in college we never once used XML for the actual code construction of web pages.

-Scrap