[CLOSED] Property for Usercontrol that uses Ext controls withing a panel

  1. #1

    [CLOSED] Property for Usercontrol that uses Ext controls withing a panel

    I'm trying to add a public property to a UserControl for setting the text of a ext:Button/Label. Basically this works however, when in our case, there's a ext:Panel around the ext:Button. In this specific case the ext:Button isn't constructed yet (null) and it throws an error. How to prevent this?

    TestPage:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication5._Default" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <%@ Register src="ExtControl.ascx" tagname="ExtControl" tagprefix="uc1" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
       <title></title>
    </head>
    <body>    
       <form id="form1" runat="server">
          <asp:ScriptManager ID="sm1" runat="server"></asp:ScriptManager>
          <ext:ScriptManager ID="ScriptManager1" runat="server"></ext:ScriptManager>
            
          <uc1:ExtControl ID="ExtControl1" runat="server" LabelText="ExtControl1 " />
       </form>
       </body>
    </html>
    TestControl:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExtControl.ascx.cs" Inherits="WebApplication5.ExtControl" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <script type="text/C#" runat="server">
       public String LabelText
       {
           set
           {
          Label1.Text = value;
           }
       }
    </script>
    <ext:Panel ID="Panel1" runat="server" Title="TestPanel">
       <Body>
          <ext:Label ID="Label1" runat="server" Text="Label1"></ext:Label>
       </Body>
    </ext:Panel>
  2. #2

    RE: [CLOSED] Property for Usercontrol that uses Ext controls withing a panel

    ... ignore post, following this topic
  3. #3

    RE: [CLOSED] Property for Usercontrol that uses Ext controls withing a panel

    hmmm.... I'm not sure why, but there does appear to be a problem. Your sample should work, but I can confirm an NullReferenceException is thrown.

    We are investigating.

    Geoffrey McGill
    Founder
  4. #4

    RE: [CLOSED] Property for Usercontrol that uses Ext controls withing a panel

    Hi,

    Fixed. Please update from SVN


Similar Threads

  1. Replies: 5
    Last Post: Nov 03, 2011, 2:39 AM
  2. Replies: 13
    Last Post: Jul 29, 2011, 4:24 AM
  3. [CLOSED] how to set panel html property as javascript property
    By kenanhancer in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jan 05, 2011, 6:45 PM
  4. [CLOSED] [1.0] Load dynamic UserControl with Coolite Controls.
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Oct 22, 2010, 10:27 AM
  5. How to Add a GridPanel withing a Tab Content
    By yaser82 in forum 1.x Help
    Replies: 8
    Last Post: Oct 06, 2008, 3:24 PM

Posting Permissions