Forum guidelines
How to display a popup window
Posted By Prashant More on 09 Jul 2008

Hello All,

I want to display a popup window when i click on a button.Please anyone send me the code.


Thanks & Regards

Prashant S. More

Re: How to display a popup window
Posted By ramarajan ra on 09 Jul 2008  


try in this link, i found this and cleared my solution, try this link





Re: How to display a popup window
Posted By Niradhip Chakraborty on 09 Jul 2008  

You can do it by using javascript. Say your popup page name is 'ForgotPassword.aspx'
and your button id is 'btnGo'


.aspx page coding:

<script language="javascript">

      function OpenForgotPassword()
  x = window.showModalDialog(strUrl,"newwin","dialogHeight:20;dialogWidth:36; status:No; edge:Raised; center:yes; help:No; resizable:No; ") 

.aspx.cs page coding
protected void Page_Load(object sender, EventArgs e)
    btnGo.Attributes.Add("onclick","return OpenForgotPassword();");


Niradhip(James Hetfield)
Please remember to click “Do you like this answer” on the post that helps you.
Re: How to display a popup window
Posted By Ryan Alford on 11 Jul 2008  
or this will do it for the ForgotPassword.aspx page....

Response.Write("<script type=\"text/javascript\">window.showModalDialog('ForgotPassword.aspx',null,'status:no;center:yes;dialogWidth:500px;dialogHeight:300px;help:no;scroll:no');</script>");

Re: How to display a popup window
Posted By kareem elhosseny on 12 Jul 2008  
u can use this
it working with me

Response.Write("<SCRIPT>'your page.aspx', 'Fame',  'scrollbars=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, width=600, height=400', true</SCRIPT>");

K@reem Elhosseny
C# Corner Annual Conference 2016


Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.