Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 464009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:13:56+00:00 2026-05-12T23:13:56+00:00

This is somewhat related to another question I’ve asked but I figure why not

  • 0

This is somewhat related to another question I’ve asked but I figure why not ask it seperately.

If I were to place something like the following in a view

<td><img src='<%= Url.Action( "DisplayImage" , "User" , new { id = item.id} ) %>' alt="" /></td>

Is it supposed to display this?

<td>
   <img src='/User.mvc/DisplayImage?id=U00915441' alt="" />
</td>

Or would the value of the src-attribute actually be replaced with the results of the UserController GetImage Action?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:13:56+00:00Added an answer on May 12, 2026 at 11:13 pm

    It will construct the path to the action, returning a url, not the results of executing the action.

    The results will be:

    <td>
       <img src='/User.mvc/DisplayImage?id=U00915441' alt="" />
    </td>
    

    Example code. assumes your user model has the image stored in a byte array. If you are using LINQ and the property is a Binary, then use the ToArray() method to convert it to a byte array. Note the attributes which will require that the user be logged in and using a GET request.

    [Authorize]
    [AcceptVerbs( HttpVerbs.Get )]
    public ActionResult DisplayImage( string id )
    {
         var user = ...get user from database...
    
         return File( user.Image, "image/jpeg" );
    }
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is somewhat related to another question that I've asked that I've pretty much
On another question , Jerry Coffin pointed out the following: It's (probably) not really
If this has already been asked, please link and close this one. I'm currently
This is a challenge question / problem. Hope you find it interesing. Scenario: You
I was posting some comments in a related question about MVC caching and some
I'm tryin to grasp the fundamentals of Cocoa (Iphone) MVC design, but it's being
I am trying to create a (child) JFrame which slides out from underneath one
I am developing a JSF web application on a Windows box using Emacs as
So I'm working on rewriting a program for a professor, and I have some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.