I'm trying to open an image in new brrowser tab like this:
<a href="" target="_blank">
<img height="660px" width="420px"
src="<%= Url.Action("WebPageImage", "WPMManagement", new { id = actualId }) %>"
alt="bild mit webseiten version" />
</a>
I need to show 开发者_开发技巧just an image and nothing else (no styles etc.) What about href? What do I need in it?
Change the href attribute to the URL of your image and you're good to go:
<a href='<%= Url.Action("WebPageImage", "WPMManagement", new { id = actualId }) %>' target="_blank">Click here to view the image</a>
EDIT: If you're retrieving images from the database, then you'll need Url.Action rather than Url.Content. Check out this question for a similar discussion about retrieving images from a database.
EDIT #2: Updated the example code to use Url.Action rather than Url.Content
精彩评论