On 22-01-2011 07:32, Tony Johansson wrote:
> "Arne Vajhøj"<(E-Mail Removed)> skrev i meddelandet
> news:4d38caf7$0$23762$(E-Mail Removed)...
>> On 20-01-2011 18:04, Tony Johansson wrote:
>>> "Arne Vajhøj"<(E-Mail Removed)> skrev i meddelandet
>>> news:4d38b713$0$23761$(E-Mail Removed)...
>>>> On 20-01-2011 02:04, Tony Johansson wrote:
>>>>> "Arne Vajhøj"<(E-Mail Removed)> skrev i meddelandet
>>>>> news:4d378200$0$23754$(E-Mail Removed)...
>>>>>> On 19-01-2011 09:18, Tony Johansson wrote:
>>>>>>> I read in a book and the text say the following.
>>>>>>> "Let's look at a typical Web request from a browser to show how the
>>>>>>> ASP.NET
>>>>>>> runtime goes into action. The client request a file, for example
>>>>>>> default.aspx from the server. All ASP.NET Web pages usually have the
>>>>>>> file
>>>>>>> extension .aspx. Because this file extension is registered with IIS,
>>>>>>> or
>>>>>>> known by the Visual Web Devepoper Web server, the ASP.NET runtime and
>>>>>>> the
>>>>>>> ASP.NET worker process get into the picture. With the first request
>>>>>>> to
>>>>>>> the
>>>>>>> file default.aspx, the ASP.NET parser is started, and the compiler
>>>>>>> compiles
>>>>>>> the file together with a C# file that is associated with the .aspx
>>>>>>> file
>>>>>>> and
>>>>>>> creates an assembly.
>>>>>>> Then the assembly is compiled to native code by the JIT compiler of
>>>>>>> the
>>>>>>> .NET runtime. The assembly contains a Page class that is invoked to
>>>>>>> return
>>>>>>> HTML code to the client. then the Page object is destroyed. However,
>>>>>>> the
>>>>>>> assembly is kept for the next request, so with the second request is
>>>>>>> is
>>>>>>> not
>>>>>>> decessary to compile the assembly again."
>>>>>>>
>>>>>>> What I have some difficulty to understand is the connection between
>>>>>>> the
>>>>>>> assembly that is mentioned at the end in the above text
>>>>>>> and the code that I can debug on the server. ?
>>>>>>> I mean the code in code behind file.
>>>>>>
>>>>>> Look at it graphically:
>>>>>>
>>>>>> foobar.aspx--(ASP.NET)--><random name>.cs--|
>>>>>> |--(C#
>>>>>> compiler)--><random
>>>>>> name>.dll--(JIT)-->native code in memory
>>>>>> foobar.aspx.cs-----------------------------|
>>>>>>
>>>>>> The assembly is produced from foobar.aspx and foobar.aspx.cs!
>>>>>
>>>>> Ok the assembly is created from the .aspx file and the code behind file
>>>>> but
>>>>> when I for example debug on the server side is it this assembly that I
>>>>> debug
>>>>> then ?
>>>>
>>>> In general: the code in the assembly will be executed and
>>>> the debugger will display the source code matching the code
>>>> being executed.
>>>>
>>>> I assume ASP.NET to follow the general model even though I
>>>> have never tried.
>>>
>>> I just wonder where is this assembly located that consist of the aspx
>>> file
>>> and the code behind file ?
>>> This file must be saved somewhere on disk I assume.
>>
>> Yes.
>>
>> You can ask ASP.NET where they are.
>>
>> Try make a one line .aspx with:
>>
>> <%=System.Reflection.Assembly.GetExecutingAssembly().Location%>
>
> I found it and used Red Gats Reflector to look into the DLL assembly but it
> was not so very interesting
> I found the class that I have in the code behind file and so on.
It should have all the code you are executing. Well - most of
the functionality is probably in System.Web classes.
Arne
|