Hi,
I want to open new pop-up window on click of a button.
i have one function written on aspx page using javascript. i am calling that function from "on click" event on cs page. i can not use the "onClientCall" event to call the function as before opening the popup window i need to perform some checks.
so my problem is, by the statement:
btnSubmit.Attribute.Add("onclick","ShowAlert()");
window opens but in background. i want to bring it to foreground.
can someone suggest any solution for this. or just let me know if i m missing some settings.
Niradhip ChakrabortyPosted Feb 24, 2009, 12:18 PM
Use the following code to call the javascript function from .cs file.
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "ShowAlert();", true);
write this code at the end of your submit button function.
Pravara PatilPosted Feb 23, 2009, 11:59 PM
Hi,
Thank you very much for the quick response.
i tried to use ModelDialogBox, but it has some limitations because of which it doesn't fits to my requirements.
my problem is, after opening a popup window it goes to background. i want it to remain on foreground.
the window will open after clicking on "Submit" button from cs page(i.e. after postback).
Vijaya KadiyalaPosted Feb 23, 2009, 8:17 PM
hi
check out the below link
http://www.developerfusion.com/code/4505/add-a-javascript-popup-to-an-aspnet-button/
If possible please have clear requirements once again..
Thanks -- Vijaya Kadiyala
vivek kulkarniPosted Feb 23, 2009, 9:44 AM
Hi,
Your problem was not clear to me. i think you can use the window.showModalDialog() function to open the window in the foreground.
It will be great if you ellaborate a little bit.
Thank you,
Vivek