An ImageButton that retrieves its image from a Resource

Discussion in 'ASP .Net Building Controls' started by ~~~ .NET Ed ~~~, Apr 2, 2005.

  1. 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
     
    ~~~ .NET Ed ~~~, Apr 2, 2005
    #1
    1. Advertising

  2. ~~~ .NET Ed ~~~

    Brock Allen Guest

    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
     
    Brock Allen, Apr 2, 2005
    #2
    1. Advertising

  3. ~~~ .NET Ed ~~~

    Robert Rae Guest

    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

    >
    >
    >
    >
     
    Robert Rae, Jun 22, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. K B
    Replies:
    1
    Views:
    800
    Winista
    Jun 5, 2006
  2. thunk
    Replies:
    1
    Views:
    347
    thunk
    Mar 30, 2010
  3. thunk
    Replies:
    0
    Views:
    522
    thunk
    Apr 1, 2010
  4. thunk
    Replies:
    14
    Views:
    654
    thunk
    Apr 3, 2010
  5. Replies:
    13
    Views:
    233
    Scott Bryce
    Dec 9, 2005
Loading...

Share This Page