How Code behind file and single file are process.

A

archana

Hi all,

I am confuse regarding concept of code behind model and single file
model..

I have heard that single file model compiles dynamically.

suppose i have application in which i am having one aspx page and its
equivalent cs file i completed my application and deployed dll and
aspx page.

And in second application, i have only singe file containing html as
well as server side coding.
In this case i only have to add this file to prodeuction server. My
question is how this file is compiled? Means will it use 'temporary
asp.net files' folder to store page details?

any help will be truely appreciated.
 
S

Scott M.

Both senarios will use the Temporary ASP.NET Files folder but no .dll
(assembly) causes dynamic compilation.

When you call for an ASP.NET page (.aspx file), the first thing the server
does is notice (by the extension of the file) that it should be processed
using "ASPNET_ISAPI.dll", which you can think of as a server-side processing
engine.

This engine will begin to search for an assembly for this application in the
/bin folder of the application directory. If it can't find a pre-compiled
assembly in the /bin folder, it knows to use dynamic compilation and to look
inside the file for the code.

When a code-behind is used, the engine makes an instance of the class
specified in the .aspx file (which would normally be in the assembly stored
in the /bin folder). If you have a code-behind, but no assembly, then we're
back to the same process I just described, but if there is an assembly, then
you don't need the code-behind at all because its code is compiled into the
assembly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top