Monday, December 12, 2005

close button for a popup window in ASP.Net (c#)

Found some nice code to create a close button for a popup window in ASP.Net (c#)

///
/// Create javascript to close the current window
///

/// Button to click to close the window
public static void CreateCloseButton(Button btn)
{
btn.Attributes.Add("onclick", "return window.close();");
}

2 comments:

Unknown said...

i am geting Error that closebutton alredy contains definition

Simon said...

can you specify the exact error please?