Implement a modal Dialog box in ASP.NET web app

  • Thread starter Thread starter Ritu Kachroo
  • Start date Start date
R

Ritu Kachroo

I need to implement a Dialog box in my Web application.

The dialog box pops up with "OK", "Show Details", "Show Image" buttons
when the user clicks a marked point on a chart. I need to pass the
numeric value of the point into the Dialog Box.
And after the user selects "Show Details" or "Show Image" buttons, I
need to pass that value into another web form to display the required
details.

How can I implement this? Can someone give me some sample code for the
javascript functions I need to incorporate in my C# code.
 
Thanks Peter.. I know the functions to use.. am just not sure about the
implementation..
So, I need some sample code for the javascript functions.

I am currently using the following piece of code to open the popup
window:

string javStr = "<script> var
win=window.showModalDialog('popup.aspx',null,'center:yes;status:no;dialogWidth:425px;dialogHeight:100px;toolbar:yes;dialogHide:true;help:no;scroll:no');</script>";
if(!this.IsStartupScriptRegistered("OpenWin"))
this.RegisterStartupScript("OpenWin", javStr);

But the problem with that is it opens the popup window twice!
What am I doing wrong ?

Secondly, I need to know how to pass the value of a local variable from
the parent form into the popup form.

And last, how to retrieve that value in the popup form (using
window.returnValue function).
 
Back
Top