RegisterClientScriptResource ?? .js w/ whidbey

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Apologies if this is in the wrong newsgroup -- couldn't find one for whidbey
web dev.

I am having a problem using .js file w/ whidbey. Currently I have a .js
file referenced on every page in my website. It works fine when I run the
website in debug mode (F5). Excellent, even.

The problem comes when I try to publish the website.

The .js file is not deployed w/ the rest of the files when I publish the
site. ONLY the .js file is not published. Obviously this causes some
problems.

I looked into why it might not work...and this page about 'WebResources'
helped a little: http://www.microsoft.com/indonesia/msdn/WebResource.asp.

I attempted to 'register' the javascript file so that I could get to it w/
the webresource URL -- but I can't find much documentation about the
function. I tried the following:
Page.ClientScript.RegisterClientScriptResource(typeof(string),
"../Template/SoDorky.js");
String test = Page.GetWebResourceUrl(typeof(string),
"../Template/SoDorky.js");

And 'test' gets a value...but not one that works when I try to reference the
file on a page with '...javascript src = <%=test%>...'. The second function
always returns something regardless of if the resource has been registered,
it seems.

I believe my problem is because of my 'typeof(string)' parameter...but I
don't know what to put there otherwise.

On a sidenote: I'd *really* rather just publish the darn .js file along with
the rest of the website and not worry about registering the file. Normally I
would've changed the 'build action' of the properties for that file to
something like 'content' or the like (as in a normal programming project) --
but the properties for the files in my website only contain filename and full
path properties.

Thanks for the help,
- Zack
 
The reason you can't publish your .js file is a bug in beta 1...

it's bug # FDBK14209 and FDBK12424

It has been acknowledged by microsoft.

You can get a list of bugs by searching:
http://lab.msdn.microsoft.com/productfeedback/default.aspx

And the newsgroups are private right now, and can be accessed via:
http://communities.microsoft.com/newsgroups/default.asp?icp=whidbey&amp;slcid=us

you'll find directions there on how to use this in your newsclient, or can
use it through that web interface.

KArl
 

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