开发者

asp.net mvc3 adding javascript file as linked file

I am adding any script file in disk (by Add Existing item > Add as link), to standard mvc3project/scripts folder the file has not seen in compiled version. When i change the referenced js file's properties, Copy to output always or change build action to content or compile the result is the same. How can i add a js file to asp.net mvc project as linked file.

Step by Step

  1. In asp.net mvc3 project there is folder named "Scripts"
  2. And i want to add a jsc开发者_Go百科ript file to this folder.
  3. But i dont want to add file as physically.
  4. I right click on the scripts folder. Add new item. Select the js file. And click the add as linked file.
  5. the file appears on the script folder. But when i run the site. The file could not be found by the web application.


Unfortunately, Visual Studio doesn't copy linked Javascript files. The best solution I've seen so far is the use of a post-build action as proposed in this answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜