开发者

Does code in aspx page get compiled in a web application?

Let me just start by saying, if anyone knows of开发者_开发技巧 a good article that talks about this subject, please point me towards it.

Does code in an .aspx page (in between <% %> tags) get compiled in a web application or is it treated like markup where you can just change it without recompiling the solution? Does compiling only compile the code behind code in the .cs and designer.cs files ?


If you're developing in a 'Web Application Project' (as opposed to 'Web site') then any change to class (.cs), code-behind file (.aspx.cs), designer files, etc (basically anything that isn't markup or static files like .htm) would require a rebuild in Visual Studio.


All code within a .aspx file, in or out of code blocks (<%%>) gets compiled.

Changing an .aspx file will cause IIS to recompile it on the next request.

See MSDN - ASP.NET Dynamic Compilation.


Update (following comment):

As for development work - pretty much the same happens when you use the dev web server to view the page. You do not have to recompile the solution/project, but the page will get recompiled dynamically.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜