Re: embedded resource



Hi and thanks for replying ... but I still dont understand... for instance
in the second url they where pointing to the Build Action property which
isnt available anymore (?) ...

I am aware of that it isnt easy to understand what my problem really is... i
dont know for sure myself ... anyhow ... This is what I have come up with:

I have placed all my image-files in the App_GlobalResources-folder and added
them to a Images.resx file in the same folder. Then I created a aspx-file
for retrieving these images as the code below shows. Is this approach sane?
or is there some other more common method I have missed?

public partial class ASP_GetResource : System.Web.UI.Pag
{
protected void Page_Load(object sender, EventArgs e)
{
System.Drawing.Bitmap image = GetGlobalResourceObject("Images",
ResourceKey) as System.Drawing.Bitmap;
Response.ContentType = "image/gif";
image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif);
image.Dispose();
}

string ResourceKey { get { return Request.QueryString["res"]; }}
}

/Andreas

> Hi,
>
> sure, these are called web resources and you can generate the call needed
> to fetch them.
>
> Here's link to tutorial:
> http://www.asp.net/QuickStart/aspnet/doc/extensibility.aspx#WR
>
> But basically, you specify it to be a web resource with WebResource
> attribute and access it with Page.ClientScript.GetWebResourceUrl () call.
>
> And here's a good article on the subject
> http://aspalliance.com/726
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke


.



Relevant Pages

  • Re: What kind of horse does a first-horse-owner even need? A plodder? A paddock-basher?
    ... > be able to go to the Pony Clubs that the horse people over here go to. ... You dont need to worry about collection or any of the ... She isnt a bad mover but she isnt a great mover. ... Dont worry about 'training'. ...
    (rec.equestrian)
  • Re: Adding a File menu in HTA
    ... Mayayana / McKirahan ... It isnt that I dont want to use an IE instance.....I am happy to. ...
    (microsoft.public.scripting.vbscript)
  • Re: can Spinal Taps help diagnose Lyme?
    ... nothing to do with Hydrogen pyroxide or ultra violet light.. ... They use different procedures there and it probably isnt even ... procedure name but I dont. ... Maybe twice a year. ...
    (sci.med.diseases.lyme)
  • Re: CD drive problem
    ... Maybe you arent waiting for the CD to initialize. ... Dont click on OK immediatly. ... If this isnt the problem Windows may ...
    (microsoft.public.windowsxp.hardware)

Quantcast