Hi everyone :)

I'm using the Desktop example which I got from here.
On client-side I'm using the createDynamicWindow which I got from here.

C# / ASP.Net / JS

I made a search in the forum and google and haven't found anything that could help me :(
My problem is:
I have a base window form and all others windows will inherit from this...
But ...
All the windows come from database including the main window.
Then I do the following to solve the problem but I think it's a workaround

At code behind I have:

When the user click at link I call the NewForm method passing the form name as a parameter

public void NewForm(string moduloPrefixo, string formName)
    StreamWriter file = null;//arquivo a ser criado
    string FileName = Server.MapPath(".") + @"\" + Settings.GetValue<string>("ROOTURL") + moduloPrefixo + @"\";
    //verifica se o diretório do módulo existe
    if (Directory.Exists(FileName) == false)
 //não... então cria
    FileName += formName;
    if (File.Exists(FileName)) File.Delete(FileName);
    //codigo que será gerado no arquivo
    string Codigo = "";
 //criar o arquivo solicitado
 file = new StreamWriter(FileName,
     false, System.Text.Encoding.GetEncoding(1252));
 //carrega o MainForm.
 //É obrigatório existir o MainForm na definição.
 Script.Script script = new ERP.Script.Script("MainForm");
 if (script.HasRows == false)
     throw new ExceptionMainFormNotDefined();
  * no FormMain devolvido tem que existir a tag #body# para o C# saber onde vai ser colocado
  * o script definido pelo usuário
 if (!script.Code.Contains("#body#"))
     throw new ExceptionMainFormBodyNotDefined();
 Codigo = script.Code;
 script = new ERP.Script.Script(moduloPrefixo, formName);
 if (script.HasRows &amp;&amp; !string.IsNullOrEmpty(script.Code))
     Codigo = Codigo.Replace("#body#", script.Code);
     throw new ExceptionFormNotDefined(formName);
    catch (Exception ex)
 throw ex;
 if (file != null)
at design page I have:

<ext:TreeNode Text="Root">
    <ext:TreeNode Text="Cadastros" Icon="add">
     <ext:TreeNode Text="Cliente">
      <BeforeClick Handler="Coolite.AjaxMethods.NewForm('CAD', 'frmCliente.aspx');"/>                                                                                  
      <Click Handler="createDynamicWindow(#{DeskTop_}, 'forms\\CAD\\frmCliente.aspx', 'Cadastro de Clientes', 'idCadCliente1', 510, 615);" />
It work. But... I don't think it's the best solution...

Does anybody have any idea to help me?