views:

19

answers:

1

How to open a popup page that has parameters(calculated in button event) in button event

ButtonClick()
{
    string id=TextBox.Text;
    /////HERE i want to open a popup as "Index.aspx?ID=id" ///////

}

PLESE RESPOND SOON

+1  A: 

You can't really open a normal popup window from code-behind, you have to do it from the client-side.

So, you can make a Javascript function that opens the window with window.open, accepting some parameters, and then use in code-behind ClientScriptManager.RegisterClientScriptBlock to make the JS function run after your button click.

http://msdn.microsoft.com/en-us/library/bahh2fef.aspx

Dan Dumitru
i can do like this , but suppose i make a function in java script through method u told ....than how i ll call that method ...????
Asad
suppose JS fucntion a() is created on client side from a server side event .....than how in same event i will call that fucntion of
Asad
@Asad - "than how I'll call that method?" - like I said, with ClientScriptManager.RegisterClientScriptBlock. Check that link I've included, it also has an example of how to use it.
Dan Dumitru