[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Display HTML (bullets) in asp.net

Posted on 2008-06-25
15
Medium Priority
?
3,279 Views
Last Modified: 2013-11-26
     I tried to use the following codes to display a bullet list in asp.net:

      String stringBullet = "<UL><LI>point1</LI><LI>point2</LI></UL>" ;
      Label.Text = stringBullet;

      But it failed to display the bullet.

      When I debug it in Visual Studio, use the "HTML visualization", I can see the stringBullet = "<UL><LI>point1</LI><LI>point2</LI></UL>"  displayed as bullet.

      Any help is appreciated
     


   
0
Comment
Question by:BrainyYack1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
  • +1
15 Comments
 
LVL 18

Expert Comment

by:Joel Coehoorn
ID: 21868517
Label controls automatically part <, >, &, etc into the appropriate entities: &lt;, &gt:, &amp;, etc.  You want to use a literal control for this instead.
0
 
LVL 14

Accepted Solution

by:
Dustin Hopkins earned 1000 total points
ID: 21868602
Also if that doesn't work you may want to check any css you're using to verify you haven't hidden the bullets or anything.
0
 

Author Comment

by:BrainyYack1
ID: 21868951
I tried literal control, but it does not work.
The following is what I used:
   <asp:Literal ID="LiteralDescription" runat="server"></asp:Literal>
   LiteralDescription.Text = "<UL><LI>point1</LI><LI>point2</LI></UL>"

I did not use any css for the label and Literal control .
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

Author Comment

by:BrainyYack1
ID: 21868983
Sorry I forgot to say that the text part of the bullet is displayed. The problem is that the symbol (such as round dot) part of the bullet is not displayed.
0
 
LVL 18

Expert Comment

by:Joel Coehoorn
ID: 21869046
First open the rendered page in the browser and view your source there to make sure the rendered html is what you expected.  If it is, then I have to point you back to what dusion said:  check your styles.  Is it possible a style intended to act somewhere else is cascading to this element, too?
0
 

Author Comment

by:BrainyYack1
ID: 21869611

 Yes, dusion and jcoehoorn are right. It is the css that hides the bullet symbol.

Now the bullet symbol can be displayed in IE, but cannot be displayed in Firefox.

Please give further help, thanks.
0
 
LVL 14

Expert Comment

by:Dustin Hopkins
ID: 21869708
when you view the page, is it atleast displaying the html correctly in both browsers?
0
 

Author Comment

by:BrainyYack1
ID: 21869765
Yes. the html  is the same in both browser. Please see the follow:
IE:
<UL><LI>
<DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3><SPAN id=ctl00_ContentPlaceHolder1_lblJobCategory>asasasasas</SPAN></FONT></DIV></LI></UL>

FireFox:
<UL><LI>
<DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3><SPAN id=ctl00_ContentPlaceHolder1_lblJobCategory>asasasasas</SPAN></FONT></DIV></LI></UL>
0
 
LVL 18

Expert Comment

by:Joel Coehoorn
ID: 21870197
</FONT> ?  That's not strictly valid html, since the font tag is deprecated and it's not correctly paired with an opening tag.  It could easily be what's confusing the browser's rendering.
0
 
LVL 18

Expert Comment

by:Joel Coehoorn
ID: 21870207
Oops:  just spotted the opening font tag.
0
 
LVL 14

Expert Comment

by:Dustin Hopkins
ID: 21870313
hmm...i would take another look at the css, as the code above shows fine in both browsers, of course i couldn't test it with the class, that looks like one of those word formatted output, you should definatly clean that up. one way to test if its the css is just put the text <UL><LI>point1</LI><LI>point2</LI></UL> into the page, outside of the literal control...if you still don't see the bullets then there is somesort of css that is screwing with your output. Also does it work if you take out the mso formatted divs?
0
 
LVL 18

Expert Comment

by:Joel Coehoorn
ID: 21870334
Copied your code to a plain html file- no extra styles or anything to get in the way.  The bullet shows fine for me.  If you view this file and the bullet shows up, it's definitely a style problem.  If the bullet does not show up, you've done something to your browsers.
0
 
LVL 18

Expert Comment

by:Joel Coehoorn
ID: 21870346
Ah, it looks like it lost my file.  You'll have to rename this to an html file instead of a txt file.
a.txt
0
 

Author Comment

by:BrainyYack1
ID: 21874176

jcoehoorn said it. it is because of my firefox which cached the previous css. After I cleared the cache in firefox, the bullet shows.

Thank dusion and jcoehoorn very much!
0
 
LVL 2

Expert Comment

by:Rajkumar_G
ID: 22545679
hi
can you try this way?

<ul>

<li type="circle">Circle bullet style</li>

<li type="disc">Disc bullet style</li>

<li type="square">Square bullet style</li>

</ul>
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question