ext.net Error : Control with type 'System.Web.UI.WebControls.SqlDataSource' cannot be handled by layout

  1. #1

    ext.net Error : Control with type 'System.Web.UI.WebControls.SqlDataSource' cannot be handled by layout

    i have a web form .inside of this ,i am loading usercontroler via <ext:UserControlLoader . my user controler contains an sqldatasource.when i run the page ,i got the error something like this "Control with type 'System.Web.UI.WebControls.SqlDataSource' cannot be handled by layout".

    my web form is like this;
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
       <ext:Panel runat="server">
       <Items>
      <ext:UserControlLoader ID="UserControlLoader4" runat="server" Path="~/Controlers/SinifListe.ascx" />
       </Items>
     </panel>
    and my usercontrol

     <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:AProjeConnectionString %>"
        SelectCommand="SELECT * FROM [Sinif]"></asp:SqlDataSource>
    
    <ext:Panel runat="server" ID="mainpanelone" Title="listele" Flex="1" BodyStyle="background-color:#DFE9F6">
        <Items>
                    <ext:Container ID="Container1" runat="server" Layout="HBoxLayout" Flex="1">
                        <Items>
                             <ext:GridPanel ID="GridPanel2" runat="server" Title="Sınıf " Frame="true"  Width="300">
                                <Store>
                                    <ext:Store ID="Store2" runat="server" DataSourceID="SqlDataSource2">
                                        <Model>
                                            <ext:Model ID="Model2" runat="server" IDProperty="Id">
                                                <Fields>
                                                    <ext:ModelField Name="Id" />
                                                    <ext:ModelField Name="Ad" />
                                                </Fields>
                                            </ext:Model>
                                        </Model>
                                    </ext:Store>
                                </Store>
                                <ColumnModel ID="ColumnModel2" runat="server">
                                    <Columns>
                                        <ext:Column ID="Column1" runat="server" DataIndex="Id" Text="Id" />
                                        <ext:Column ID="Column2" runat="server" DataIndex="Ad" Text="Ad" />
                                    </Columns>
                                </ColumnModel>
                            </ext:GridPanel>
                        </Items>
                    </ext:Container>
        </Items>
    </ext:Panel>
    how can i solve this problem. *i put sqldatasources inside of the web form and problem solved,however, i wanna use sqldatasources inside of my usercontroler

    i ve already tried this approach

    <ext:GridPanel ID="GridPanel2...
        <Bin>
            <asp:SqlDataSource ID="SqlDataSource2"...
        </Bin>
    </ext:GridPanel>

    however i get the error like this;

    Parser Error Message: Ext.Net.ItemsCollection`1[[Ext.Net.Observable, Ext.Net, Version=2.0.0.0, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87]] must have items of type 'Ext.Net.Observable'. 'asp:SqlDataSource' is of type 'System.Web.UI.WebControls.SqlDataSource'
  2. #2
    Unfortunately it's impossible. GridPanel inherits the Bin property from AbstractComponent and this property is defined as ItemsCollection<Observable>, so, an component added to the Bin must inherits from Observable. If you try to add an SqlDataSource to the Bin on C# you are gonna receive a compile error instead of runtime error.
    Last edited by RCN; Nov 30, 2012 at 4:56 PM.
  3. #3
    so , i cant use sqldatasource inside the usercontrols !! ???


    ** i clearly understand why i cant use sqldatasource in bin property via your post ,however what should i do ,what's the solution ,??
    Last edited by ada; Dec 04, 2012 at 7:55 AM.
  4. #4
    Inside the Bin element, it's impossible
  5. #5
    Quote Originally Posted by ada View Post
    what the hell!!! u serious !! ??
    This language is not appropriate on these forums. Please do not post comments like this again.


    You can use the <HtmlBin> instead of the <Bin> property.
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 11
    Last Post: Mar 20, 2013, 4:43 PM
  2. Replies: 8
    Last Post: Jul 20, 2012, 1:33 PM
  3. Replies: 2
    Last Post: Jun 06, 2012, 3:38 PM
  4. Replies: 5
    Last Post: Jan 05, 2012, 10:03 AM
  5. Replies: 4
    Last Post: Feb 01, 2011, 11:54 AM

Posting Permissions