How to embed image or javascript file into custom server control dll

  • Thread starter Thread starter Big Dave
  • Start date Start date
B

Big Dave

Good morning, does anyone know of a good tutorial, or have insight into
how to embed an image or javascript file into a custom server control
for asp.net?

Thanks for your help!!!

Big Dave
 
In VS.Net you can mark any file to be embedded into the dll...if you click
the file, go into it's properties, you can change the Build Action to
"Embedded Resource"

You can then get the file via
System.Reflection.Assembly.GetExecutingAssembly().GetFile("blah.js") which
returns a FileStream you can then read to get the contents of...

This is assuming the code is running from the current assembly, you can read
another assemblies embedded resources by load that specific assembly instead
of using the GetExecutingAssembly shortcut

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 

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

Back
Top