0

I would like to know if it is possible to replace an image with a simplte text string when the image isn't displaying and how can I do it on vb.net.

Steven Doggart
  • 43,358
  • 8
  • 68
  • 105
Filipe Vilhena
  • 55
  • 1
  • 3
  • 11
  • show your in what you have tried so far. – spajce Feb 03 '14 at 12:36
  • I've tried to replace the ALT of the image,but It didn't worked, I've tried to remove the image, but that didn't work. I'm kind of lost with this. I've successfully replaced the image with an empty image or another one, but I wish to completelly remove it and show text instead (kind of the emoticon reverse) – Filipe Vilhena Feb 03 '14 at 12:39
  • .. so, what are you talking about? HTML? RTF? PDF? Something you wrote yourself? – Jongware Feb 03 '14 at 12:43
  • I'm assuming that this question is in regards to ASP.NET? – Steven Doggart Feb 03 '14 at 12:43
  • As I say in my question, it is in VB.Net but yes, it's for a web page, so asp.net with code behind in vb.net – Filipe Vilhena Feb 03 '14 at 12:45
  • try Ctrl + F5 in browser when you expect text in place of image, with ALT of the image specified.. – techBeginner Feb 03 '14 at 13:00
  • What? I didn't understand – Filipe Vilhena Feb 03 '14 at 13:01
  • 1
    Here is a similar solution... http://stackoverflow.com/questions/14100618/alternate-image-display-in-asp-net/14100791#14100791 – Aristos Feb 03 '14 at 13:02
  • Yes, that is similar, but I already can replace my image with an empty image, for example. Although that is not the desirable outcome, because I wasn't able to change the size of the image (height and width) so let's say we have an image withx 200x100 and another with 50x20 and then text, it get's very weird with all that empty space. Do you understande what I mean and what i need? – Filipe Vilhena Feb 03 '14 at 14:13
  • Answer: http://stackoverflow.com/a/12136321/3206532 – Filipe Vilhena Feb 03 '14 at 16:42

1 Answers1

0

I found the answer i needed and that worked for me here in stack overflow in another topic. The link to the answer that solved my issue is: Answer

If you wish to see the code directly without browsing to the link, here it is:

    Dim input As String = "test<img>" ' your data here
    Dim imgRegex As New Regex("<img[^>]*>", RegexOptions.IgnoreCase)
    Dim output As String = imgRegex.Replace(input, "")
Community
  • 1
  • 1
Filipe Vilhena
  • 55
  • 1
  • 3
  • 11