Embedding Resources into ASP.NET 2.0 Project

B

Bob Trabucco

Hello all,

I have a ASP.NET website written using VS 2003. I am in the process of
migrating it up to 2005.

There is one problem I just can't seem to solve.

In my original VS 2003 project I had a few icons and bitmaps included in the
project with their build action set as "Embedded Resource". Through code I
generated some bitmaps using these items for the user to see. Nothing
radical

So I create my VS 2005 project and add the Icons and Bitmaps.

There isn't anyplace I see to mark it as an embedded resource anymore!
Where is this setting hidden nowadays????

Thanks in advance,

Bob
 
B

Bob Trabucco

Thanks for the relpy Steve

It's a Visual Studio 2005 project created by just selecting New and Website

When I bring up the properties page for the file all I get are 2 fields -
"file name" and "file path". No "Build Action" to be found! In fact those
are the only 2 properties I see for any file in the entire project

I saw the stuff about:

[assembly: System.Web.UI.WebResource("myImage.gif", "img/gif")]
[assembly: System.Web.UI.WebResource("myStylesheet.css", "text/css")]
[assembly: System.Web.UI.WebResource("myJavascript.js", "text/js")]

and accessing them by

Page.ClientScript.GetWebResourceUrl(...)

and such but this code is shared with a .NET Desktop app and I was hoping to
keep it all the same like it worked with Visual
Studio 2005 using the System.Reflection.Assembly.GetManifestResourceStream()

Thanks!

Bob
 
B

Bob Trabucco

OOPS!

Small correction...

I was hoping to keep it all the same like it worked with Visual Studio 2003
(Not 2005) using the System.Reflection.Assembly.GetManifestResourceStream()


Bob Trabucco said:
Thanks for the relpy Steve

It's a Visual Studio 2005 project created by just selecting New and
Website

When I bring up the properties page for the file all I get are 2 fields -
"file name" and "file path". No "Build Action" to be found! In fact
those are the only 2 properties I see for any file in the entire project

I saw the stuff about:

[assembly: System.Web.UI.WebResource("myImage.gif", "img/gif")]
[assembly: System.Web.UI.WebResource("myStylesheet.css", "text/css")]
[assembly: System.Web.UI.WebResource("myJavascript.js", "text/js")]

and accessing them by

Page.ClientScript.GetWebResourceUrl(...)

and such but this code is shared with a .NET Desktop app and I was hoping
to keep it all the same like it worked with Visual
Studio 2005 using the
System.Reflection.Assembly.GetManifestResourceStream()

Thanks!

Bob





Steve C. Orr said:
Sure you can set them as embedded resources! What kind of a project is
it you're creating?
Just select the file in solution explorer and you should see the Build
Action property.
Alternately for many kinds of projects you can set embedded resources
from the Resources tab of the project properties dialog.

Here's more info:
http://aspalliance.com/726
http://www.codeproject.com/aspnet/MyWebResourceProj.asp
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top