With the MVC3 Razor synax, one may render a string like so
@ViewData("photo")
My problem is: How can I append a dot to the above code.
The following will result in a “Public member ‘jpg’ on type ‘String’ not found.”:
@ViewData("photo").jpg
I’ve tried the following code but does not produce my intended result:
@ViewData("photo") .jpg
@ViewData("photo"):.jpg
@ViewData("photo") & ".jpg"
Thanx for advance for your help.
And please dont advice me to append the “jpg” in the controller’s code like so:
ViewData("photo") = "filename.jpg"
I’ve searched the Net for the same problem but found none, not even something
similar.
By the way, I’m using VB.net.
Adding as answer:
@(ViewData(“photo”) + “.jpg”)