Hi I was just wondering how to pop up a new window in asp.net. I have searched from the database....and if it doesn't return any results than I want a new window to popup...How do we do this concept....thanks for ur help in advance...
Printable View
Hi I was just wondering how to pop up a new window in asp.net. I have searched from the database....and if it doesn't return any results than I want a new window to popup...How do we do this concept....thanks for ur help in advance...
It depends on what page event you want the window to pop up on...
Let's say you have a button named Button1 and you want a new window to pop up when the button is clicked then your code would look like this:
PHP Code:// C# code
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
string winURL = "http://www.vbforums.com/";
string features = "height=600,width=800,resizable=yes";
Button1.Attributes.Add("onclick", "javascript:window.open('"
+ winURL + "', null, '" + features + "');");
}