In my website I have two forms: parent form and child form(dialog box). Their expected behaviour is like this: if clicked on 'show' button on parent form, a dialog form opens that displays a gridview. In dialog form, if clicked on 'select' button it closes itself and returns value in selected row back to parent form.
To achieve this I write following code (.cs) : in parent form:
void ShowBtn_Click(object sender, EventArgs e)
{
StringBuilder jScript = new StringBuilder();
jScript.Append("var WinSettings = 'center:yes;resizable:no;dialogHeight:300px';\n");
jScript.Append("window.showModalDialog('FileList.aspx', WinSettings);\n");
Page.ClientScript.RegisterStartupScript(this.GetType(), "SumbitScript1", jScript.ToString(), true) ...
Go to the complete details ...