1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
   |  protected System.Web.UI.HtmlControls.HtmlInputHidden ReturnValueObj;  
  ShowDialogBox (ReturnValueObj ,"WebForm1.aspx",200,50,0,0,true);  
  private void ShowDialogBox(System.Web.UI.HtmlControls.HtmlInputHidden ReturnValueObj,string sURL ,int width ,int height, int x,int y, Boolean isCenter )   {    string sFeature="";    string sJs="";        sFeature += "dialogHeight:" + height + "px;";    sFeature += "dialogWidth:" + width + "px;";    if (isCenter == false)     {     sFeature += "dialogLeft:" + x + "px;";     sFeature += "dialogTop:" + y + "px;";    }    sJs = "<script>";    sJs += "Form1." + ReturnValueObj.ClientID + ".value =window.showModalDialog('WebForm2.aspx?url=" + sURL + "','','" + sFeature + "');";    sJs += "</script>";    this.RegisterStartupScript("ShowDialogBox",sJs);        string script ="<script>";    script +="if(Form1." + ReturnValueObj.ClientID + ".value != \"\") { window.alert(Form1." + ReturnValueObj.ClientID + ".value); } ";    script +="</script>";    this.RegisterStartupScript("ShowAlert",script);   }
 
  |