Reputation: 1562
I want to make a link from what the user filepath that is given from an openfiledialog. But I can't get all the quotes in the right places
DOCTextBox.Text = "<a href=" & OpenFileDialog1.FileName & "target=_"blank">" & TitleTextBox.Text & "</a>"
Upvotes: 0
Views: 347
Reputation: 887837
In order to put a "
in a VB.Net string literal, you need to write ""
.
For example:
"<a href=""" & HttpUtility.HtmlAttributeEncode(OpenFileDialog1.FileName) _
& """target=_""blank"">" & HttpUtility.HtmlEncode(TitleTextBox.Text) & "</a>"
Upvotes: 2
Reputation: 755219
It sounds like you're trying to add quotes into the final string produced from the expression. In order to do that use a pair of double quotes ""
. For example
"<a href=""" & OpenFileDialog1.FileName & """></a>"
Upvotes: 0
Reputation: 730
DOCTextBox.Text = "<a href=""" & OpenFileDialog1.FileName & """ target=_""blank"">" & TitleTextBox.Text & "</a>"
Upvotes: 1