<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Matt Tester</title>
    <link>http://www.pureblue.co.nz/blog/</link>
    <description>.NET and other things</description>
    <language>en-us</language>
    <copyright>Matthew Tester</copyright>
    <lastBuildDate>Mon, 02 Apr 2007 04:13:27 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.0.0.0</generator>
    <managingEditor>matt@pureblue.co.nz</managingEditor>
    <webMaster>matt@pureblue.co.nz</webMaster>
    <item>
      <trackback:ping>http://www.pureblue.co.nz/blog/Trackback.aspx?guid=4f142596-a550-41cc-9112-af78cebc7a90</trackback:ping>
      <pingback:server>http://www.pureblue.co.nz/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.pureblue.co.nz/blog/PermaLink,guid,4f142596-a550-41cc-9112-af78cebc7a90.aspx</pingback:target>
      <dc:creator>matt@pureblue.co.nz (Matt Tester)</dc:creator>
      <wfw:comment>http://www.pureblue.co.nz/blog/CommentView,guid,4f142596-a550-41cc-9112-af78cebc7a90.aspx</wfw:comment>
      <wfw:commentRss>http://www.pureblue.co.nz/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=4f142596-a550-41cc-9112-af78cebc7a90</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I've just fixed a strange bug I was having when comparing a web page in IE and Firefox.
      The page simply had a single textbox, and a button. By default, in accordance with
      W3C standards, both browsers will post-back to the server when the user hits &lt;Enter&gt;
      from within the textbox.
   </p>
        <p>
      Just the behaviour I wanted, except that when the post-back occurs from IE, the button's
      event handler does not get triggered on the server!! Very strange ... but <a href="http://aspnet.4guysfromrolla.com/articles/060805-1.aspx">this
      article</a> on <a href="http://aspnet.4guysfromrolla.com/">4guysfromrolla.com</a> gives
      a great explanation.
   </p>
        <p>
      Basically, IE does not post-back a fully serialised form if there is only one
      textbox on the page! The server does not know what triggered the post-back and so
      cannot call the correct server-side event handler. The workaround? ... add another
      textbox to the form (but just make it hidden!).
   </p>
        <p>
      This is true for IE6 and IE7 ...
   </p>
        <img width="0" height="0" src="http://www.pureblue.co.nz/blog/aggbug.ashx?id=4f142596-a550-41cc-9112-af78cebc7a90" />
        <br />
        <hr />
   Pure Blue Consulting Ltd.</body>
      <title>IE - "Postback when Enter pressed" bug!</title>
      <guid>http://www.pureblue.co.nz/blog/PermaLink,guid,4f142596-a550-41cc-9112-af78cebc7a90.aspx</guid>
      <link>http://www.pureblue.co.nz/blog/IE++Postback+When+Enter+Pressed+Bug.aspx</link>
      <pubDate>Mon, 02 Apr 2007 04:13:27 GMT</pubDate>
      <description>&lt;p&gt;
   I've just fixed a strange bug I was having when comparing a web page in IE and Firefox.
   The page simply had a single textbox, and a button. By default, in accordance with
   W3C standards, both browsers will post-back to the server when the user hits &amp;lt;Enter&amp;gt;
   from within the textbox.
&lt;/p&gt;
&lt;p&gt;
   Just the behaviour I wanted, except that when the post-back occurs from IE, the button's
   event handler does not get triggered on the server!! Very strange ... but &lt;a href="http://aspnet.4guysfromrolla.com/articles/060805-1.aspx"&gt;this
   article&lt;/a&gt;&amp;nbsp;on &lt;a href="http://aspnet.4guysfromrolla.com/"&gt;4guysfromrolla.com&lt;/a&gt; gives
   a great explanation.
&lt;/p&gt;
&lt;p&gt;
   Basically, IE does not post-back a fully serialised form if&amp;nbsp;there is only one
   textbox on the page! The server does not know what triggered the post-back and so
   cannot call the correct server-side event handler.&amp;nbsp;The workaround? ... add another
   textbox to the form (but just make it hidden!).
&lt;/p&gt;
&lt;p&gt;
   This is true for IE6 and IE7 ...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.pureblue.co.nz/blog/aggbug.ashx?id=4f142596-a550-41cc-9112-af78cebc7a90" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Pure Blue Consulting Ltd.</description>
      <comments>http://www.pureblue.co.nz/blog/CommentView,guid,4f142596-a550-41cc-9112-af78cebc7a90.aspx</comments>
      <category>ASP.NET;Gotcha's</category>
    </item>
    <item>
      <trackback:ping>http://www.pureblue.co.nz/blog/Trackback.aspx?guid=52854a36-00eb-4027-a778-976a967ad585</trackback:ping>
      <pingback:server>http://www.pureblue.co.nz/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.pureblue.co.nz/blog/PermaLink,guid,52854a36-00eb-4027-a778-976a967ad585.aspx</pingback:target>
      <dc:creator>matt@pureblue.co.nz (Matt Tester)</dc:creator>
      <wfw:comment>http://www.pureblue.co.nz/blog/CommentView,guid,52854a36-00eb-4027-a778-976a967ad585.aspx</wfw:comment>
      <wfw:commentRss>http://www.pureblue.co.nz/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=52854a36-00eb-4027-a778-976a967ad585</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      It's not an error message that you see often when working with ASP.NET, but if you’re
      deploying to a new, clean machine, it can happen quite easily.
   </p>
        <p>
          <img alt="Failed to access IIS metabase screenshot" src="http://www.pureblue.co.nz/blog/content/binary/iisError1.png" border="0" />
        </p>
        <p>
      The problem comes around due to the order that components were installed on the machine,
      namely that The .NET Framework was installed <strong>before</strong> IIS. As
      a result, ASP.NET is not correctly configured to run. The easiest way to rectify this
      is to re-install ASP.NET with IIS.
   </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">aspnet_regiis
      –i</span>
        </p>
        <p>
      If you only require default settings then this is the easiest option. The Microsoft
      KB specified in the error message suggests the <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">–ga</span> switch,
      but that requires a little more knowledge of the Windows system as it requires you
      to specify the Windows User Account to run under (which is different between Windows
      2000, XP, 2003, etc). Easier to simply use the <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">–i</span> switch!
   </p>
        <img width="0" height="0" src="http://www.pureblue.co.nz/blog/aggbug.ashx?id=52854a36-00eb-4027-a778-976a967ad585" />
        <br />
        <hr />
   Pure Blue Consulting Ltd.</body>
      <title>IIS Error - "Failed to access IIS metabase"</title>
      <guid>http://www.pureblue.co.nz/blog/PermaLink,guid,52854a36-00eb-4027-a778-976a967ad585.aspx</guid>
      <link>http://www.pureblue.co.nz/blog/IIS+Error++Failed+To+Access+IIS+Metabase.aspx</link>
      <pubDate>Mon, 20 Nov 2006 17:46:12 GMT</pubDate>
      <description>&lt;p&gt;
   It's not an error message that you see often when working with ASP.NET, but if you’re
   deploying to a new, clean machine, it can happen quite easily.
&lt;/p&gt;
&lt;p&gt;
   &lt;img alt="Failed to access IIS metabase screenshot" src="http://www.pureblue.co.nz/blog/content/binary/iisError1.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
   The problem comes around due to the order that components were installed on the machine,
   namely that The .NET Framework was installed&amp;nbsp;&lt;strong&gt;before&lt;/strong&gt; IIS. As
   a result, ASP.NET is not correctly configured to run. The easiest way to rectify this
   is to re-install ASP.NET with IIS.
&lt;/p&gt;
&lt;p&gt;
   &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;aspnet_regiis
   –i&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
   If you only require default settings then this is the easiest option. The Microsoft
   KB specified in the error message suggests the &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;–ga&lt;/span&gt; switch,
   but that requires a little more knowledge of the Windows system as it requires you
   to specify the Windows User Account to run under (which is different between Windows
   2000, XP, 2003, etc). Easier to simply use the &lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;–i&lt;/span&gt; switch!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.pureblue.co.nz/blog/aggbug.ashx?id=52854a36-00eb-4027-a778-976a967ad585" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Pure Blue Consulting Ltd.</description>
      <comments>http://www.pureblue.co.nz/blog/CommentView,guid,52854a36-00eb-4027-a778-976a967ad585.aspx</comments>
      <category>ASP.NET;Gotcha's</category>
    </item>
    <item>
      <trackback:ping>http://www.pureblue.co.nz/blog/Trackback.aspx?guid=cb33f59b-4037-49e5-b522-a36f895a7af9</trackback:ping>
      <pingback:server>http://www.pureblue.co.nz/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.pureblue.co.nz/blog/PermaLink,guid,cb33f59b-4037-49e5-b522-a36f895a7af9.aspx</pingback:target>
      <dc:creator>matt@pureblue.co.nz (Matt Tester)</dc:creator>
      <wfw:comment>http://www.pureblue.co.nz/blog/CommentView,guid,cb33f59b-4037-49e5-b522-a36f895a7af9.aspx</wfw:comment>
      <wfw:commentRss>http://www.pureblue.co.nz/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=cb33f59b-4037-49e5-b522-a36f895a7af9</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p class="MsoNormal">
      A problem I had recently was that a GridView bound to a SqlDataSource was not deleting
      the records when the Delete command was executed. I've tagged this entry as a "gotcha"
      as it isn't completely obvious where the problem might be to the uninitiated. 
   </p>
        <p class="MsoNormal">
      The Delete Sql command was executing fine, but after using SqlProfiler I noticed that
      the “ID” parameter was set to “Null”, hence the fact that no record was deleted. This
      was not what I expected as I had used the normal SqlDataSource and DataGrid wizard
      to set up the controls. What I was missing was setting the “DataKeyNames” property
      on the GridView to the name of the primary key of my data … “ID”. Now, the SqlDataSource
      passed through the correct Sql statement and all was good!
   </p>
        <p class="MsoNormal">
      I’ve avoided the SqlDataSource/Designer approach whenever possible for the very reason
      that it’s difficult to see what’s going on when something doesn’t work. I was creating
      a prototype so time pressures won out and I used it!
   </p>
        <img width="0" height="0" src="http://www.pureblue.co.nz/blog/aggbug.ashx?id=cb33f59b-4037-49e5-b522-a36f895a7af9" />
        <br />
        <hr />
   Pure Blue Consulting Ltd.</body>
      <title>GridView Update/Insert/Delete doesn't work with SqlDataSource</title>
      <guid>http://www.pureblue.co.nz/blog/PermaLink,guid,cb33f59b-4037-49e5-b522-a36f895a7af9.aspx</guid>
      <link>http://www.pureblue.co.nz/blog/GridView+UpdateInsertDelete+Doesnt+Work+With+SqlDataSource.aspx</link>
      <pubDate>Mon, 10 Jul 2006 08:16:04 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
   A problem I had recently was that a GridView bound to a SqlDataSource was not deleting
   the records when the Delete command was executed. I've tagged this entry as a "gotcha"
   as it isn't completely obvious where the problem might be to the uninitiated. 
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
   The Delete Sql command was executing fine, but after using SqlProfiler I noticed that
   the “ID” parameter was set to “Null”, hence the fact that no record was deleted. This
   was not what I expected as I had used the normal SqlDataSource and DataGrid wizard
   to set up the controls. What I was missing was setting the “DataKeyNames” property
   on the GridView to the name of the primary key of my data … “ID”. Now, the SqlDataSource
   passed through the correct Sql statement and all was good!
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
   I’ve avoided the SqlDataSource/Designer approach whenever possible for the very reason
   that it’s difficult to see what’s going on when something doesn’t work. I was creating
   a prototype so time pressures won out and I used it!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.pureblue.co.nz/blog/aggbug.ashx?id=cb33f59b-4037-49e5-b522-a36f895a7af9" /&gt;
&lt;br /&gt;
&lt;hr /&gt;Pure Blue Consulting Ltd.</description>
      <comments>http://www.pureblue.co.nz/blog/CommentView,guid,cb33f59b-4037-49e5-b522-a36f895a7af9.aspx</comments>
      <category>ASP.NET;Gotcha's</category>
    </item>
  </channel>
</rss>