So lets say I want to make a change to some content on one of my views for my MVC project. Something really simple like taking out a sentence or adding a period or something. So from w开发者_如何学Pythonhat I see, I have to republish the entire site, then take down the whole site and replace it with the newly publish set.
I was wondering if there was a way, if I make a change to a single page's content that I could just replace the single page, without having to replace the entire site. I remember in web forms I could replace a single page if I made a change. Thoughts ?
The content resides in a View directory which are none other than aspx files. For the very first request for the aspx page, it is compiled by the ASP.NET Server(IIS) and cached on the server for serving further requests.
So you can just replace the aspx file(in respective View's folder) with new content and it will be subsequently compiled for the first request. There is no need to put down the whole site.
For more information about the lifecycle of ASP.NET page visit :
http://msdn.microsoft.com/en-us/library/ms178472.aspx
What is the 'page lifecycle' of an ASP.NET MVC page, compared to ASP.NET WebForms?
You can replace a single aspx or ascx file without taking down the site. They aren't compiled by default. However, if you change any compiled code then that is clearly a different ballgame.
精彩评论