title: The FormView fired event ModeChanging which wasn't handled.
body: <p>Ok, so I'm struggling with using asp:formview.</p>
  
  <p>I've got the formview up and running and I've added the 'Edit' button. </p>
  
  <pre><code>&lt;asp:FormView runat="server" id="fwHotelDetails" DataKeyNames="id" OnDataBound="fwHotelDetails_DataBound" OnModeChanging="fwHotelDetails_ModeChanging" &gt;
      &lt;ItemTemplate&gt;
          // (..) some code here which outputs some data
  
          &lt;asp:Repeater runat="server" id="repScore"&gt;
            &lt;ItemTemplate&gt;
              &lt;span class="item"&gt; Some output here&lt;/span&gt;
              &lt;asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /&gt;
            &lt;/ItemTemplate&gt;
          &lt;/asp:Repeater&gt;
  
          &lt;EditItemTemplate&gt;
               Test test, anything??
          &lt;/EditItemTemplate&gt;
  
      &lt;/ItemTemplate&gt;
  &lt;/asp:FormView&gt;
  </code></pre>
  
  <p>I've tried thefollowing solutions in the code behind - none of them works:</p>
  
  <pre><code>protected void fwHotelDetails_ItemCommand(object sender, FormViewModeEventArgs e)
  {
      if (e.CommandName.Equals("Edit"))
      {
          fwHotelDetails.ChangeMode(e.NewMode);
      }
  }
  </code></pre>
  
  <p>and  this:</p>
  
  <pre><code>protected void fwHotelDetails_ModeChanging(object sender, System.Web.UI.WebControls.DetailsViewModeEventArgs e)
  {
      fwHotelDetails.ChangeMode((FormViewMode)e.NewMode);
  }
  </code></pre>
  
  <p>Clicking the Edit button only gives me the following error message:</p>
  
  <blockquote>
    <p>The FormView 'fwHotelDetails' fired event ModeChanging which wasn't handled</p>
  </blockquote>
  
  <p>What more needs to be done?</p>
  
  <p>This page is a great reference for FormView controller: <a href="http://authors.aspalliance.com/aspxtreme/sys/web/ui/webcontrols/FormViewClass.aspx" rel="nofollow noreferrer">http://authors.aspalliance.com/aspxtreme/sys/web/ui/webcontrols/FormViewClass.aspx</a></p>
  
  <p><strong>Update:</strong> I've updated code to refelct Phaedrus suggestion. 
  Current status is that even after clicking Edit button, the content from ItemTemplate is loaded.</p>