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

  •  12-07-2004, 9:37 PM

    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 Complete Thread