Tarun Malhotr
Tarun Malhotr

Reputation:

I want to open a popup on clicking a button showing an aspx page

I have seen this in the West-Wind Toolkits where they have created their control called Hover Panel but i'm not able to implement it.So,is there another method to do so.

Upvotes: 0

Views: 2537

Answers (4)

ercu
ercu

Reputation: 2565

In addition to Aarti's answer, you could open popup from asp.net code with Page's RegisterStartupScript function.

protected void Button1_Click(object sender, EventArgs e)
    {
        RegisterStartupScript("OpenPopup", "<script>popitup('PageToOpen.aspx');</script>");


    }

Upvotes: 1

Aarti
Aarti

Reputation:

ModalPopupExtender is an advanced option for pop up.

but if you want to do it simply you can use simple javascript to open popup form on button click :

Here is the script :

function popitup(url)

{

     newwindow=window.open(url,'name','height=200,width=150');

     if (window.focus) {newwindow.focus()}

     return false;

}

add this in your html source for button click :

onclick="return popitup('test.aspx')"

Upvotes: 1

Russ Cam
Russ Cam

Reputation: 125538

Have you had a look at the ModalPopupExtender as part of the ASP.NET AJAX Control toolkit?

Upvotes: 1

ravi
ravi

Reputation: 1019

you can use jquery ui dialogs for this. Check out this sample

Upvotes: 1

Related Questions