Re: .ASPX -> .CS generation

From: Lenard Gunda (frenzy_at_fbi.hu)
Date: 06/02/04


Date: Wed, 2 Jun 2004 15:54:45 +0300

It does create a C# source file!

I added:

<% if true then .. %>

to the middle of an ASPX file. It reported a CSC compile time error, and I
was able to view the file being compiled, which was auto generated, and was
a C# class derived from my code behind class of the page, that outputted
through HtmlTextWriter the page content, created and initialized the
controls based on specified attributes, and called the controls to render
themselves. It even showed me the command line that was used to compile it.
The command line contained the temporal filesnames as well.

No doubt, it does many things when requesting an ASPX file, but this step is
one of it, and I am wondering if there is a program that can be used (or
command line arguments to something) to generate this .CS file?

-Lenard

"ranganh" <anonymous@discussions.microsoft.com> wrote in message
news:67A23672-B775-43B7-BBE4-3AD174E54731@microsoft.com...
> Dear Lenard,
>
> When you make a request to an ASPX file, it is not converted into C# file.
>
> It performs object initialization
> then it loads the viewstate data
> then it performs the LoadPostData Processes Postback Data
> it then loads the objects
> then it raises postback change events
> it processes client side postback event
> then prerendering of objects take place
> viewstate is saved then
> then the HTML is rendered.
>
> when you request a page, only the HTML is rendered and the scripts are
executed only at the server side.
>
> there are hell a lot of things that happen when you request an aspx page
:) thats why when the page first loads, it
> takes sometime, the aspx page is compiled at runtime and hence takes
sometime to get loaded the first time.
>
> hope it helps.
>
>
>
>
>
>
>
>
> ----- Lenard Gunda wrote: -----
>
> Hi!
>
> When I make a request to an ASPX file, it is converted into a C#
source file
> (given, the language is C#). This source can be seen, if I
intentionally put
> in something bad between <% ... %>, because it is treated as source
code,
> and if it is wrong, the C# compiler issues an error, when compiling
this
> generated .CS file.
>
> I would like to know, what program/utility is used by IIS/ASP.NET to
> generate .CS from .ASPX? Theoretically, if I would generate the .CS
by hand,
> and compile it, it would be possible to create websites that are
fully
> compiled in a DLL, right? Is there such a utility that permits me to
do it?
> I found no information, whatsoever, about how this part of ASP.NET
works.
>
> Thanks
>
> Lenard
>
>
>



Relevant Pages

  • Re: asp.net good practices?
    ... programmatic logic code from the presentation layer. ... "Page" class and the class generated from the .aspx file. ... methods and event handlers in your code-behind class and have these ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Interpeted ASP.Net & .aspx With MS Index Server
    ... The controls for the header/footer and side menu will be compiled and be ... proper html the file will compile. ... > code outside the ASPX file like WebForm.cs etc. ... >> server via FTP. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Question About Code Behind
    ... I use following method to compile. ... > You must compile the code-behind before attempting to inherit. ... >> and highlight the aspx file code, ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Interpeted ASP.Net & .aspx With MS Index Server
    ... ASPX file will be compiled first time it is called (how are you going to ... You need to specifically compile the ASPX if you keep the ... > server via FTP. ... > and allow them to simply add the html content in the center of the screen. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Looking for a free basic compiler for DOS
    ... mother of an ide file - and created separate source files for each SUB ... big to compile in one bc step. ... the source for all the SUBS in the same source file. ...
    (comp.lang.basic.misc)