Felipe Pessoto
Felipe Pessoto

Reputation: 6969

Is there a Performance Difference in having Code in the ASPX file?

Putting code at aspx files is slower? The code is recompiled every access?

At my mind, code at aspx file is compiled at first access together their dll(maybe in Page_Init) and moved to Temp Asp.Net folder. And .aspx file just is necessary for IIS found a file.

Upvotes: 0

Views: 116

Answers (2)

Mircea Grelus
Mircea Grelus

Reputation: 2915

Having code in the aspx file or in the code-behind file makes no difference in terms of performance. Just in aesthetics.

However, compilation is a different thing, and it's actually related to deployment you choosing or the project that you created (Web Site or Web Application). Web Application is closer to the VS 2003 Web Project model and compiles all the source code during the build process and generates a single assembly.

Upvotes: 1

marcc
marcc

Reputation: 12399

Where you put the code does not impact performance. At least in a codebehind file compared to the .aspx file.

Upvotes: 1

Related Questions