Where should I save an image in my project?
I'm creating a website using MVC2. Where do I 开发者_如何学Gosave the image?
Generally in an ASP.NET MVC project, you'd put images under the Content folder, which by default has an ignore route defined to allow them to be picked up directly from there. If you want to put them elsewhere, that's fine too - just make sure you put a route in so that the folder isn't interpreted as a controller.
Really, you can save them wherever you like. The "Content" folder is the default folder (included in the MVC template) that includes images. Then there is a separate folder for "Scripts".
However I actually run an Assets folder for everything.
wwwroot/
wwwroot/Assets/
wwwroot/Assets/Images
wwwroot/Assets/Scripts
wwwroot/Assets/Styles
wwwroot/Assets/Videos
Etc
精彩评论