Passing value into a string

Posted on 2013-05-14
Last Modified: 2013-05-14

I have this code which works perfectly fine.

Dim imageString As String = String.Empty
  imageString = imageString & "<img src=""../Images/signicon.png/"""" alt="""" height=""20"" style=""filter:alpha(opacity=100);"" />&nbsp;&nbsp;"

But I would like to drop in a extra value (pathToImages) But I keep getting syntax error.

Dim pathToImages As String = ConfigurationManager.AppSettings("PathToImages")

 imageString = "<img src= " pathToImages & "/Images/pageicon.png/"""" alt="""" height=""20"" style=""filter:alpha(opacity=100);" />&nbsp;&nbsp;"

Would be grateful for any help.

Question by:Soluga
LVL 75

Accepted Solution

käµfm³d   👽 earned 500 total points
ID: 39164156
Add in another ampersand before pathToImages:

imageString = "<img src= " & pathToImages & "/Images/pageicon.png/"""" alt="""" height=""20"" style=""filter:alpha(opacity=100);" />&nbsp;&nbsp;"

Open in new window


Author Closing Comment

ID: 39164169
That's great.


Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.Net - KeyPress Event 4 37
Help with preventing selection from a combobox 11 29
Complex SQL statement in VB.NET 7 17
MailAddress in vb 4 19
User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

825 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