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

Related Questions

We have created a web application, using ASP.NET, that allows users to upload documents
I have created a new MVC2 project using the ASP.NET MVC2 Web Application, which
I have created reports using Crystal Reports in my asp.net application(vb). It was fine.
I have the following scenario. I have created an ASP.NET web application (framework 3.5)
I have created a Web Application in asp.net 2.0. which is working fine on
I'm using Quartz.NET for job scheduling in my ASP.NET application, and I have created
I have developed an web application using Asp.net ( .Net Framework 3.0). In this
I have created an ASP.Net MVC Web Application and used NuGet to install Ninject
I have created an ASP.NET Webforms web application which basically inetracts with the code
This is a Asp.net 3.5 Web Application I have a variety of data collections,

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.