Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio - Why do .ASPX files take so much longer to load than .ASPX.CS files?

This may be a stupid question, but it's something that bugs me on a regular basis, so no harm in asking here I guess.

What exactly is Visual Studio doing when I open up an .ASPX file and it takes a good 4-5 seconds longer than if I was just opening the code behind file (.ASPX.CS).

I've noticed this happening with VS 2003, 2005 and 2008, and on a newly built machine too, so it's not an issue of my dev machine being too slow.

It seems to only happen when opening any .ASPX file for the first time in a particular session though. Is there some processing going on that I can disable to get rid of this delay?

Cheers

like image 319
Chris McAtackney Avatar asked Feb 16 '09 12:02

Chris McAtackney


People also ask

What is the difference between .aspx file and .CS file?

The aspx file contains your page markup. It's automatically converted into code by ASP.NET. The cs file contains the code behind your page (initialization, event handlers, etc.). You have to write that code yourself.

What is ASPX and ASPX CS?

aspx web form in our previous asp.net tutorial. We know the web page divided in two part the Default. aspx is a design part and the Default. aspx. cs is coding part.

Does ASPX need to be compiled?

aspx. cs file) must first be compiled. This compilation can happen explicitly or automatically. If the compilation happens explicitly then the entire application's source code is compiled into one or more assemblies ( .

Why do we use ASPX?

Active Server Pages (ASPX) is a file format used by web servers and generated using the Microsoft ASP.NET framework - an open-source development framework used by web developers to create dynamic web pages, often with the . NET and C# programming languages.


2 Answers

Because Visual Studio has to process the aspx files to represent them in design view. Source files do not have a design view.

It probably caches what it needs for design view. This will make things faster the next time it wants to load the file.

like image 197
mmx Avatar answered Dec 08 '22 10:12

mmx


I just disabled HTML designer:

Tools -> Options -> HTML Designer ->
"Enable HTML designer" uptick it.

Works much more faster. Tested in VS12.

like image 36
Kostiantyn Korniyenko Avatar answered Dec 08 '22 08:12

Kostiantyn Korniyenko