Apr 27, 2012, 3:24 PM
How can I access UserControl's events after its rendering?
Good morning,
I have created a desktop window in runtime and place a rendered UserControl inside of it.
There is a form on this UserControl that saves records on the database.
After that rendering, I don't know how to access the methods from the UserControl.
This is the method that I have used to create my Desktop Window
Thanks in advance!
I have created a desktop window in runtime and place a rendered UserControl inside of it.
There is a form on this UserControl that saves records on the database.
After that rendering, I don't know how to access the methods from the UserControl.
This is the method that I have used to create my Desktop Window
BaseUserControl ucControl;
ucControl = (BaseUserControl)this.LoadControl(string.Concat(_Url + Wind + ".ascx"));
DesktopWindow d = new DesktopWindow();
d.ID = string.Concat("Wnd", Wind);
d.Title = Wind;
d.Width = 410;
d.Height = 330;
d.Maximizable = true;
d.Minimizable = true;
d.Closable = true;
d.Icon = Icon.BuildCancel;
d.CloseAction = Ext.Net.CloseAction.Close;
d.Listeners.Destroy.Handler = "destroyFromCache(this);";
d.Listeners.Close.Handler = "destroyFromCache(this);";
d.Layout = "FitLayout";
d.MonitorResize = true;
d.ContentControls.Add(ucControl);
X.Js.Call("destroyFromCache", new JRawValue(this.MyDesktop.ClientID));
this.MyDesktop.ContentControls.Add(d);
X.Js.Call("putToCache", new JRawValue(this.MyDesktop.ClientID), ucControl.ControlsToDestroy);
d.Show();
d.Render();
If I have a button responsible to bring a method from the UserControl, how should I implement this?Thanks in advance!
Last edited by geoffrey.mcgill; May 03, 2012 at 8:00 PM.
Reason: please use [CODE] tags