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(typ eof(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