Note that there are some explanatory texts on larger screens.

plurals
  1. POPerformDataBinding not firing in DataBoundControlAdapter for ListBox
    text
    copied!<p>I am trying to create a DataBoundControlAdapter for the ListBox Control, but for some reason its not firing the PerformDataBinding method in my DataBoundControlAdapter.</p> <p>According to the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.adapters.databoundcontroladapter.performdatabinding.aspx" rel="nofollow">MSDN Documentation</a>:</p> <blockquote> <p>The PerformDataBinding method is called in place of the DataBoundControl.PerformDataBinding method when a DataBoundControlAdapter control adapter is attached to a control derived from the DataBoundControl class.</p> </blockquote> <p>Which is not happening at all, any ideas?</p> <p>Here is basically how it works.</p> <p>BrowserFile:</p> <pre><code>&lt;browsers&gt; &lt;browser refID="Default"&gt; &lt;controlAdapters&gt; &lt;adapter controlType="System.Web.UI.WebControls.ListBox" adapterType="SomeNameSpace.ListBoxDataAdapter" /&gt; &lt;/controlAdapters&gt; &lt;/browser&gt; &lt;/browsers&gt; </code></pre> <p>The Adapter:</p> <pre><code>namespace SomeNameSpace { public class ListBoxDataAdapter : DataBoundControlAdapter { protected override void PerformDataBinding(System.Collections.IEnumerable data) { base.PerformDataBinding(data); // Not firing } } } </code></pre> <p>On the page:</p> <pre><code>&lt;asp:ListBox runat="server" ID="lbxStuff" DataSourceID="obsStuff" DataValueField="Value" DataTextField="Text&gt;&lt;/asp:ListBox&gt; &lt;asp:ObjectDataSource runat="server" ID="obsStuff" TypeName="Test" SelectMethod="Get"&gt; &lt;/asp:ObjectDataSource&gt; </code></pre>
 

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