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:

  1. i am geting Error that closebutton alredy contains definition

    ReplyDelete
  2. can you specify the exact error please?

    ReplyDelete