submit child window with editor back to parent w/ no postback

Last post 12-07-2004, 9:37 PM by cutechat. 2 replies.
Sort Posts: Previous Next
  •  12-07-2004, 6:55 PM 2908

    submit child window with editor back to parent w/ no postback

     temporary solution for my current architecture - I'd like to pop-up a child window with the editor in it and javascript over the contents to a hidden field or standard text area in my parent window without a submit of the parent - any examples out there ?


    orcais.com
  •  12-07-2004, 7:25 PM 2912 in reply to 2908

    Re: submit child window with editor back to parent w/ no postback

    sperndogger,

    have you check the example:

    How to create a custom button which displays a dialog?
     
    You can find the source code of this example in the download package.
     
  •  12-07-2004, 9:37 PM 2921 in reply to 2908

    Re: submit child window with editor back to parent w/ no postback

     
    For example :
     
    You have a datagrid in PageA , when the user click a row , you could render script to show a dialog as :

    (in your datagrid event , you get the primary-key of that row)
    (you need a hidden button for postback)

    int theid=(int)DataGrid1.DataKeys[e.Item.ItemIndex];
    Page.RegisterStartupScript("ShowMyDialog","<script>if(window.showModalDialog('PageB.Aspx?RowID="+theid+"',null,'dialogWidth:400px;dialogHeight:300px')){hiddenButton1.click();}</script>");

    ------------------
    and then , in the PageB , you could place a CuteEditor in it , while the Button_OK_Click:

    void Button_OK_Click...
    {
        SaveContent(int.Parse(Request.QueryString["RowID"],Editor1.Text);
        Page.RegisterStartupScript("CloseDialogAndReturnTrue","<script>top.returnValue=true;top.close();</script>");
    }
    void SaveContent(int id,string html)
    {
        ....save to database or ..
    }

    --------------

    Hope this helps .

    Regards , Terry .
View as RSS news feed in XML