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

  • SEARCH
  • Home
  • 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 8500321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:54:48+00:00 2026-06-11T00:54:48+00:00

I have several pages that show pictures, they call controller action whose code is

  • 0

I have several pages that show pictures, they call controller action whose code is shown in [art of post.Problem is the image loaded from shredding, not load in moment but first display the text, and then display the image, I tried 2 more precise method for load images but the same effect … so one by one the loading,
please for your help
current code action

    public FileContentResult ImageVew(string sourcePath)
    {

        string location = (string)Session["TicketFilePath"] + sourcePath;



        byte[] myByte = System.IO.File.ReadAllBytes(location);

        return File(myByte, "image/jpeg");


        Image i;
        using (MemoryStream ms = new MemoryStream())
        {
            ms.Write(myByte, 0, myByte.Length);
            i = Image.FromStream(ms);
        }
        return File(imageToByteArray(i.GetThumbnailImage(100, 100, () => false, IntPtr.Zero)), "image/png");
    }

    public byte[] imageToByteArray(System.Drawing.Image imageIn)
    {
        MemoryStream ms = new MemoryStream();
        imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
        return ms.ToArray();
    }

Last version this method,but not result

    public ActionResult ImageVew(string sourcePath)
    {
        FileInfo fi = new FileInfo((string)Session["TicketFilePath"] + sourcePath);

        return File(fi.FullName, Utilities.MimeType(fi.Name));
    }

    public ActionResult ImageVew(string sourcePath)
    {
        FileInfo fi = new FileInfo((string)Session["TicketFilePath"] + sourcePath);

        byte[] imageFile = System.IO.File.ReadAllBytes(fi.FullName);
        return new FileContentResult(imageFile, Utilities.ImageType(fi.Name));


    }

    public ActionResult ImageVew(string sourcePath)
    {

        FileInfo fi = new FileInfo((string)Session["TicketFilePath"] + sourcePath);
        if (fi.Exists)
        {
            byte[] imageFile = System.IO.File.ReadAllBytes(fi.FullName);

            return File(imageFile, Utilities.ImageType(fi.Name));
        }
        else return null;
    }

Image rendering 1 by 1 and image loading from network path…but after 1. loading image cashing ,and lad on moment
Please help me developer guys

Part f code then call action
with rendering m cotrol

 private void WriteDataRow(Class item, HtmlTextWriter writer) 
    {
 writer.RenderBeginTag(HtmlTextWriterTag.Td);
        writer.RenderBeginTag(HtmlTextWriterTag.Center);
        writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "20px");
        string src = Url.Action("ImageVew", new { sourcePath = item.Status.Marker });
        writer.AddAttribute(HtmlTextWriterAttribute.Src, src );
        writer.AddAttribute(HtmlTextWriterAttribute.Alt, item.Status.StatusName);
        writer.RenderBeginTag(HtmlTextWriterTag.Img);
        writer.RenderEndTag();
        writer.RenderEndTag();
        writer.RenderEndTag();
}
  • 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-06-11T00:54:49+00:00Added an answer on June 11, 2026 at 12:54 am

    Asp.net mvc will never serve more than one request at the time from the same user (same session really) unless you turn of session state or make it read only for that action.

    To the controller or the action you need to add

    [SessionState(System.Web.SessionState.SessionStateBehavior.ReadOnly)]
    

    Now this won’t work with Cassini(built in webserver in visual studio) as it only serves a single request at time but if you test with IIS express or IIS you should see them load in parallell using the first method.

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

Sidebar

Related Questions

Lest say that we have several pages that retrieve items from the same EntitySet.
I have a .JS include file, that applies to several pages. However, for one
I have some common javascript functionality that I want to share across several views/pages.
I have several php pages that have forms used to submit data. My typical
I have several functions which use jquery that are called across different pages. I'm
First let me explain. I have several addresses on the page that I put
I have a page that has several ajax submission forms. Each form has a
I have a page that contains several forms, by submitting each one of them,
i have a page that contains several submit buttons however i only want one
I have a complex page that has several user controls like galleries, maps, ads

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.