How to open a popup window in web forms without ajax modelpopupextender

18,312

Solution 1

use window.open()

 Response.Write("  <script language='javascript'> window.open('HomePage.aspx','','width=1020,Height=720,fullscreen=1,location=0,scrollbars=1,menubar=1,toolbar=1'); </script>");

Solution 2

Opening a popup window is nothing do with Ajax call it a javascript function you should use

window.open("http://www.w3schools.com")

follow the link(http://www.w3schools.com/jsref/met_win_open.asp) for further details

Share:
18,312
Learner
Author by

Learner

Updated on June 14, 2022

Comments

  • Learner
    Learner almost 2 years

    I am a windows forms developer and learning asp.net. I want to open a form as show dialog, means if I click the button another form has to popup and user should not able to click the backgroung page(like alert or confirm but has to contain controls). It is possible with ajax popupextender control. I tried like

    (Javascript)  function OpenPopup(ctrlid) {                  
                  window.open("testControls.aspx?ctrlid=" + ctrlid,"List","left = 300, top=150,scrollbars=no,resizable=no,width=400,height=280");
                  return false;
              }
    

    and code behind

    Button1.Attributes.Add("onclick", "javascript:return OpenPopup('" + this.txtlevel2.ClientID + "')");
    

    It will open the another form but allows to click on behind page. Is there any posible to do this.

  • शेखर
    शेखर over 10 years
    The question is without ajax popupextender.
  • Karl Anderson
    Karl Anderson over 10 years
    @Shekhar - ModalPopupExtender != PopupExtender, the concept is modal vs. mode-less. So what is your question, are you looking for a non-ASP.NET AJAX solution?
  • Sajad Karuthedath
    Sajad Karuthedath over 10 years
    using only this code a new window will open up..!! you will not be able to click back in this new window..!! I think that is what u want..!! use just add this code in the button click event and replace homepage.aspx with your required page..!!
  • Learner
    Learner over 10 years
    sorry for confused. I mean background(parent) page not back button.
  • Sajad Karuthedath
    Sajad Karuthedath over 10 years
    Let me know,this link may help u..!! disable back button
  • Learner
    Learner over 10 years
    No.. See whenever we click the popup page, the popup will open, until you close that popup user should not able to click on the parent page. call2catch.com click the feedback button in right side bottom. will be like facebook