MVC 4 Customizing JavaScript in ASP.Net

Asked By 20 points N/A Posted on -
qa-featured

 

I'm new to mvc 4 and I'm wondering where I should put my Custom javascript in asp.net. By 'custom', I mean scripts that are only used in specific Views or PartialViews.

I use Areas too, so that adds up the complexity. I was thinking about placing my scripts in the Script folder at the root of the application and then in a Custom sub-folder.

How would I then reference the scripts in my Views ? Should I use custom Bundles ?

 

SHARE
Answered By 0 points N/A #173215

MVC 4 Customizing JavaScript in ASP.Net

qa-featured

 

Dear user,
I have done a research for your query via Google and have found some solution for your guidance. 
You can surely bundle the scripts that go together. By using the following code, you can organize your scripts in the existing scripts folder, here is the code:
~/Scripts/Home/foobar.js
~/Scripts/Admin/baz.js
…
Hope this will help you.
Thank you.
 

Related Questions