Dynamic Control From Another Assembly Class

  1. #1

    Problem executing DirectMethod from a Class extends Window

    Hi I have a Class from another assembly that defines a window. Then I reference this class in another VS project and I cant get the listener to execute see the code:

    ExtNetErrorReport.designer.cs
        
    public partial class ExtNetErrorReport : Window
        {
            private void InitializeComponent()
            {
                ///btnSend Report
                btnSend = new Button
                {
                    ID = "btnSend",
                    Flat = true,
                    Text = "Report",
                    Icon = Ext.Net.Icon.Disk
                };
                btnSend.Listeners.Click.Handler = "Ext.net.DirectMethods.btnSend_CLick();";
                
                ///
                /// Main Window
                /// 
                this.Buttons.Add(btnSend);
                this.Width = 640;
                this.Height = 480;
                this.Modal = true;
                this.Minimizable = false;
                this.Resizable = false;
                this.AutoFocus = true;
                this.Collapsible = false;
                this.Draggable = false;
                this.Icon = Icon.BugAdd;
                this.ID = "windowErrorReport";
            }
            private Button btnSend;
        }
    ExtNetErrorReport.cs
        public partial class ExtNetErrorReport
        {
            public ExtNetErrorReport()
            {
                InitializeComponent();
            }
    
            [DirectMethod]
            public void btnSend_CLick()
            {
                Ext.Net.X.MessageBox.Notify("Hi", "LLLL").Show();            
            }
    This code is in the Project I want to reference the class

    protected void btnNew_Click(object sender, DirectEventArgs e)
    {
    	try
    	{
    		....
    	}
    	catch (Exception ex)
    	{
    		bugs.extnet.ExtNetErrorReport myErro = new bugs.extnet.ExtNetErrorReport();
    		myErro.Render(this.form);
    	}
    }
    Thanks
    Last edited by camazorro; Apr 25, 2012 at 1:31 PM.
  2. #2

    Anyone

    Anyone with a suggestion will be appreciated

    Thanks
  3. #3
    Hi

    I really need this

    Thanks
  4. #4
    Hi,

    Can you combine all this into a single .aspx that we could drop into our local test project and run without having to make a bunch of changes? This will help get you a speedy response.

    One thing I don't understand is what is the purpose of the ExtNetErrorReport.designer.cs file. Typically a .designer.cs file is is not to be edited and is used only by Visual Studio.
    Geoffrey McGill
    Founder
  5. #5

    Thanks

    Quote Originally Posted by geoffrey.mcgill View Post
    Hi,

    Can you combine all this into a single .aspx that we could drop into our local test project and run without having to make a bunch of changes? This will help get you a speedy response.

    One thing I don't understand is what is the purpose of the ExtNetErrorReport.designer.cs file. Typically a .designer.cs file is is not to be edited and is used only by Visual Studio.
    Hi

    Maybe I dont ask correctly

    I found the solution in this post, is not related to my original question but it have the solution :)

    The .designer.cs file I created to imitate Visual Studio windows form development. I will put all the code that defines the control properties in the .designer.cs and the DirectMethods in the non .designer.cs. I did this instead or making a Logic and UI folders like you have in the example of combination samples. Its only I feel more comfortable in this way

    Click image for larger version. 

Name:	VS.png 
Views:	60 
Size:	3.6 KB 
ID:	4172

    Thanks
  6. #6
    Quote Originally Posted by camazorro View Post
    Hi

    Maybe I dont ask correctly

    I found the solution in this post, is not related to my original question but it have the solution :)

    The .designer.cs file I created to imitate Visual Studio windows form development. I will put all the code that defines the control properties in the .designer.cs and the DirectMethods in the non .designer.cs. I did this instead or making a Logic and UI folders like you have in the example of combination samples. Its only I feel more comfortable in this way

    Click image for larger version. 

Name:	VS.png 
Views:	60 
Size:	3.6 KB 
ID:	4172

    Thanks
    ok, thanks for the update. Glad to hear you have this working now.

    To help others in the future, it would be great if you could post an update with the solution you used to fix the problem.
    Geoffrey McGill
    Founder
  7. #7

    Sure

    Quote Originally Posted by geoffrey.mcgill View Post
    ok, thanks for the update. Glad to hear you have this working now.

    To help others in the future, it would be great if you could post an update with the solution you used to fix the problem.
    Later I will prepare the solution and upload attachment
  8. #8

    Example Code

    Hello Guys

    I will work on a example during this weekend to post it here. Basically I'm working with asp.net application and the controls are loaded from a class library outside of the main project. Its no a big deal but, I hope that will help someone.

Similar Threads

  1. [CLOSED] Css Class for Ext.Net Control
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 20, 2012, 8:59 AM
  2. Replies: 0
    Last Post: May 21, 2012, 2:02 AM
  3. how find dynamic control
    By maxdiable in forum 1.x Help
    Replies: 0
    Last Post: Feb 18, 2012, 8:12 PM
  4. [1.2] ClientID of dynamic control changes
    By michaeld in forum 1.x Help
    Replies: 1
    Last Post: Oct 02, 2011, 11:08 AM
  5. Dynamic Control Loading
    By dtamils in forum 1.x Help
    Replies: 2
    Last Post: Aug 11, 2011, 7:17 AM

Posting Permissions