Reputation: 41
//Insert new url in the image tag
src = "src=\"" + context.Request.Url.Scheme + "://" + context.Request.Url.Authority + src + "\"";
Receiving Syntax error at "://" while converting from C# to to VB.NET.
Upvotes: 0
Views: 66
Reputation: 155145
As @Olvarsham's answer puts, VB escapes double-quotes by doubling them.
However I feel it would be cleaner to rewrite the expression as a format-string:
src = String.Format("src=""{0}://{1}{2}""", context.Request.Url.Scheme, context.Request.Url.Authority, src)
If you reference context.Request.Url
above, it gets simpler:
Dim url As Url = context.Request.Url
src = String.Format("src=""{0}://{1}{2}""", url.Scheme, url.Authority, src)
Upvotes: 3
Reputation: 1731
The escape sequence in VB.NET
is by doubling the double-quotes.
src = "src=""" + context.Request.Url.Scheme + "://" + context.Request.Url.Authority + src + "\"""
Upvotes: 2