Re: An ImageButton that retrieves its image from a Resource

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I can't find any documentation on retrieving an imagebutton's image from a
resource file in asp.net 2.0.

Can someone help with a small example or a link to documentation.

"Brock Allen" wrote:

> This is built in into ASP.NET 2.0. For ASP.NET 1.x you can build your own
> by building a HttpHandler to extract the resource. Here's a sample app that
> shows a HttpHandler implementation:
>
> http://staff.develop.com/ballen/blog/PermaLink.aspx?guid=2d8b430b-8361-416d-9df8-9aff48bf2481
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
> > Well, that sums it up, doesn't it? I would like to have an image
> > button (more compact than a regular button) in a web custom control.
> > However, to minimize dependencies and limit installation nuisances I
> > was thinking of retrieving the image of the image button from an
> > embedded resource, only that seems not to be possible because
> > ImageButton has an ImageUrl property and that alone is not enough.
> >
> > I have seen an article where first the image was obtained from a
> > resource and then saving it to a file and then using that to feed to
> > the ImageUrl property. Problem with that -in addition of being
> > extremely cumbersome- is the need for write permissions.
> >
> > I have tried to look for other alternatives but both Image and
> > HtmlImage do not accept a Bitmap object that could possibly be
> > retrieved from an embedded resource.
> >
> > So.... is there anything like that out there? any ideas?
> >
> > Thx,
> > Emil
>
>
>
>
.


Quantcast