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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:39:01+00:00 2026-05-11T11:39:01+00:00

In an ASP.NET 3.5 application, I have created an ashx handler as below: using

  • 0

In an ASP.NET 3.5 application, I have created an ashx handler as below:

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using System.Web.Services;  namespace TestWebConfig {     [WebService(Namespace = 'http://tempuri.org/')]     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]     public class Handler1 : IHttpHandler     {          public void ProcessRequest(HttpContext context)         {             context.Response.ContentType = 'image/jpg';             BinaryReader br = new BinaryReader(File.Open( @'d:\Temp\images\AutumnLeaves.jpg', FileMode.Open ));              int bufferLength = 1000;              do             {                 byte[] buffer = br.ReadBytes(bufferLength);                 context.Response.OutputStream.Write(buffer, 0, buffer.Length);                 if (buffer.Length < bufferLength)                 {                     break;                 }             } while (true);             br.Close();         }          public bool IsReusable         {             get             {                 return true;             }         }     } } 

In an aspx page, if I specify:

<img alt='alt2' src='Handler1.ashx' style='border-width:0px'/> 

then the web page is loaded into the browser together with the image. On the other hand, if I use:

<asp:Image ID='Image2' runat='server' /> 

and in code-behind:

protected void Page_Load(object sender, EventArgs e) {    Image2.ImageUrl = 'Handler1.asxh'; } 

then the Image2 control does not load the picture, although the associated html code looks alike. Only the alt text is shown. What’s wrong?

Thanks

  • 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. 2026-05-11T11:39:01+00:00Added an answer on May 11, 2026 at 11:39 am

    For one thing in your Page_Load it looks like you’ve given it the wrong extension, but I don’t think that’s the problem.

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

Sidebar

Ask A Question

Stats

  • Questions 70k
  • Answers 70k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Ideally you should never be using it, because Parameterized queries… May 11, 2026 at 12:55 pm
  • added an answer The Attach and Detach methods are called by ExtensionCollection<T>.InsertItem and… May 11, 2026 at 12:55 pm
  • added an answer The best thing is, give him a task, similar to… May 11, 2026 at 12:55 pm

Related Questions

In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary
In an ASP.NET 3.5 site we have a relatively standard payment checkout progess that
In building an ASP.NET 3.5 WAP, I'm always frustrated by the feeling that no
I have an ASP.Net 3.5 website running in IIS 6 on Windows Server 2003
In visual studio, I have an asp.net 3.5 project that is using MS Enterprise
In ASP.NET 3.5 (with IIS6), are AppDomains are created for every request? I know
I have a main page that I want to be a sort of dispatch
I'm working on a project where I need the following. WCF service on the
I have an ASP.NET 3.5 Website (visual studio lingo), but the site continues to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.