Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I copied part of your code and I made an experiment and I think, I'm experimenting the same behavior.</p> <p>This is what I did:</p> <pre><code>&lt;asp:LinqDataSource runat="server" ID="lds" TableName="jobs" ContextTypeName="WebApplication2.DataAccess.PubsDataContext" &gt; &lt;/asp:LinqDataSource&gt; &lt;asp:LinqDataSource runat="server" ID="ldse" TableName="employee" ContextTypeName="WebApplication2.DataAccess.PubsDataContext" OnSelecting="ldse_Selecting"&gt; &lt;/asp:LinqDataSource&gt; &lt;asp:FormView runat="server" DefaultMode="Edit" ClientIDMode="Predictable" DataKeyNames="emp_id" DataSourceID="ldse" AllowPaging="true" OnItemCommand="Unnamed_ItemCommand" ID="formView"&gt; &lt;EditItemTemplate&gt; &lt;div&gt; &lt;asp:DropDownList runat="server" ID="ddlJobs" DataSourceID="lds" DataTextField="job_desc" DataValueField="job_id"&gt; &lt;/asp:DropDownList&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:TextBox runat="server" TextMode="MultiLine" ID="txtDesc" /&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:Button Text="Save" runat="server" CommandName="Save" CausesValidation="true" /&gt; &lt;asp:Button Text="Cancel" runat="server" CommandName="Cancel" CausesValidation="false" /&gt; &lt;/div&gt; &lt;/EditItemTemplate&gt; &lt;PagerSettings Mode="NextPreviousFirstLast" FirstPageText="&amp;amp;lt;&amp;amp;lt; First" LastPageText="Last &amp;amp;gt;&amp;amp;gt;" NextPageText="Next &amp;amp;gt;" PreviousPageText="&amp;amp;lt; Prev" Position="TopAndBottom" /&gt; </code></pre> <p>These are my observations:</p> <ul> <li><p>If the <code>FormView</code> <strong>contains only one row,</strong> then the <code>FormView</code> behaves weird and my commands do not work as expected.</p> <ul> <li><p>My <code>Save</code> command is never fired, instead the `Cancel command is fired</p></li> <li><p>My <code>Cancel</code> command causes my <code>FormView</code> to disappear...</p></li> </ul></li> </ul> <p>First I thought this was because of the <code>&amp;amp;</code> characters, but <strong>this is not the case</strong></p> <p>I narrowed the problem to <code>Position="TopAndBottom"</code></p> <ul> <li><p>If you set the <code>Position</code> attribute to:</p> <ul> <li><p>Top</p></li> <li><p>TopAndBottom</p></li> </ul> <p>You will experiment the same problem. (As you mention probably a bug)</p></li> <li><p>If you set the <code>Position</code> attribute to:</p> <ul> <li>Buttom</li> </ul> <p>It works as expected</p></li> </ul> <p>To be honest, if this is a bug, I can't believe none else has found it and report it.</p> <p>I made the same experiment with Visual Studio 2012 for Web (ASP.NET 4.5) and I'm experimenting the exact same behavior... </p> <p>This makes me think that probably I'm doing something fundamentally wrong and perhaps this is not a bug and that's why I'm experimenting the same behavior with both versions ASP.NET 4 and ASP.NET 4.5, but if that's the case, I simply can't figure out what is it.</p> <p>On the other hand, if this is a bug, the same bug will be present in ASP.NET 4.5</p> <h2>Edit 1</h2> <p><a href="https://github.com/jupaol/SO-Answers/blob/master/Visual%20Studio%202012/src/SO/WebForms/WebForms_1/Topics/DataBinding/FormViewPagerBug.aspx" rel="nofollow">I uploaded the code to my GitHub site for reference</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload