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 6999595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:33:43+00:00 2026-05-27T20:33:43+00:00

I am creating an imageresult.. but the public override void ExecuteResult (ControllerContext Context) says:

  • 0

I am creating an imageresult.. but the “public override void ExecuteResult (ControllerContext Context)” says: no suitable method found to overide.

my class looks like this..

    public override void ExecuteResult(ControllerContext Context)
    {
        byte[] bytes;
        string contentType = GetContentTypeFromFile();

        //if there's no context, stop the processing
        if (Context == null)
        {
            throw new ArgumentNullException("context");
        }

        //check for file
        if(File.Exists(_path)){
            bytes = File.ReadAllBytes(_path);
        }
        else{
            throw new FileNotFoundException(_path);
        }


        //
        HttpResponseBase response = Context.HttpContext.Response;
        response.ContentType = contentType;

        MemoryStream imageStream = new MemoryStream(bytes);

        byte[] buffer = new byte[4096];

        while (true)
        {
            int read = imageStream.Read(buffer, 0, buffer.Length);

            if (read == 0)
                break;

            response.OutputStream.Write(buffer, 0, read);
        }

        response.End();

    }
  • 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-27T20:33:44+00:00Added an answer on May 27, 2026 at 8:33 pm

    Does your class subclass ActionResult? Try the following:

    using System.Web.Mvc;
    
    public class ImageResult : ActionResult 
    {
      public override void ExecuteResult(ControllerContext Context)
      {
        ...
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
Creating extensions got much easier with Vs2010, but this seems not to be the
Creating the closure is easy but using it is confusing for me. Here is
Creating an Iphone application, I used to perform INSERT QUERY on different databases. But
Creating a simple TCP server based on examples but still do not get how
Creating a view with following code. - (void)loadView { paintView=[[UIView alloc]initWithFrame:CGRectMake(0, 50, 320, 430)];
creating users through mysql admin, but unable to login mysql command line following on-line
Creating an ATL project in MSVC seems to create not one but two projects;
Creating a simple public/private keypair, such as through ssh-keygen does not create a file
Creating a website using simple html(not html5) and css but got stock in mouseover

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.