<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Execution Ordering</title><link>http://blogs.technet.com/michael_platt/archive/2004/07/29/200499.aspx</link><description>I have been writing a program for the last few days which does some complex data mining using Google as a web service. I have been writing it in asp2.0 using VS 2005 Whidby Beta 1. Whilst I have the basics working I have come to realise that the complexity</description><dc:language>en-GB</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Execution Ordering</title><link>http://blogs.technet.com/michael_platt/archive/2004/07/29/200499.aspx#200590</link><pubDate>Thu, 29 Jul 2004 20:28:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:200590</guid><dc:creator>Anderson Imes</dc:creator><description>Most of ASP.NET I learned from the Wrox Press book &amp;quot;Professional ASP.NET 1.1&amp;quot; (&lt;a target="_new" href="http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764558900.html"&gt;http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764558900.html&lt;/a&gt;).&lt;br&gt;&lt;br&gt;I did a lot of research, and being from a classic asp background, I found this book very helpful.  It does not involve Visual Studio much - mostly just ASP.NET.  The first several chapters describe in detail the execution order of a page and its interraction with the CLR and IIS.  Very good.&lt;br&gt;&lt;br&gt;Visual Studio does a lot for you and most things are better done in the codebehind, but there are times when it makes a lot more sense to dive into the HTML and add some code.  I find that a lot of the programmers I've worked with are resistant to this approach and I think it makes their applications less efficient and harder to read.  I like this book because it tells you when best to use codebehind or use inline C# in HTML view.</description></item><item><title>re: Execution Ordering</title><link>http://blogs.technet.com/michael_platt/archive/2004/07/29/200499.aspx#207840</link><pubDate>Wed, 04 Aug 2004 19:38:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:207840</guid><dc:creator>Ian Griffiths</dc:creator><description>You seem to be assuming that just because something is on the .aspx page itself (and not the code behind) that this means it runs on the client.  At least that's how it seems when you ask the question &amp;quot;why didn’t this work on the client?&amp;quot;&lt;br&gt;&lt;br&gt;In fact, the .aspx page can contain a mixture of client-side and server-side code.  Anything inside a &amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt; block, or inside &amp;lt;% ... %&amp;gt; or &amp;lt;%= ... %&amp;gt; tags runs on the server. Anything else runs on the client.&lt;br&gt;&lt;br&gt;If your code truly was on the client, then that would explain why it didn't work - the set of classes and facilities available to you on the client are completely different from what's available on the server: client side code basically gets to use DHTML functionality, while server-side code (whether it's on the .aspx or the codebehind) gets to use the .NET framework. Likewise, the set of services visible on the network will likely be different.&lt;br&gt;&lt;br&gt;And I'm pretty sure you know this...  :-)  So I think this is really a case of terminology - I don't think you reall mean &amp;quot;on the client&amp;quot; here.&lt;br&gt;&lt;br&gt;The real question is: how does server-side code on the .aspx get hooked up with everything else. And the answer is: it depends on whether it's a &amp;lt;script&amp;gt; block or a &amp;lt;% ... %&amp;gt; block. And the simplest way to find out what happens is to set the Debug=&amp;quot;true&amp;quot; flag in the Page directive, and introduce a deliberate compilation error, and hit the page from a web browser running on the same box as the server. If you do this, ASP.NET will dump out the source code that it generated for your .aspx page. That will let you see where it puts the code.&lt;br&gt;&lt;br&gt;I'd strongly recommend Fritz Onion's book on ASP.NET - it's the best I've read on the subject. It explains the order in which things occur when a page is rendered, and how the .aspx relates to the code that gets generated. (And it explains all of the rest of ASP.NET too...)</description></item><item><title>re: Execution Ordering</title><link>http://blogs.technet.com/michael_platt/archive/2004/07/29/200499.aspx#208002</link><pubDate>Wed, 04 Aug 2004 23:47:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:208002</guid><dc:creator>Michael Platt</dc:creator><description>Thanks for this Ian, yes, i didnt mean &amp;quot;on the client&amp;quot;. Thanks for the debug tip and the book, I will follow it up&lt;br&gt;Mike</description></item></channel></rss>