By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,294 Members | 2,645 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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!)
"Big Dave" <pr******************@yahoo.com> wrote in message
news:eS**************@tk2msftngp13.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.