back up codes

always have a backup of your code

Archive for the tag “javascript”

closing a window

The following code will close an open window upon a linkbutton click.

This code will ask you for a confirmation before closing the window:

lnkbtnClose.Attributes.Add("onclick", "return confirm('Are you sure you want to logout?')")

This code will automatically close the window upon clicking:

lnkbtnClose.Attributes.Add("onclick", "window.close();")

open a new window

This code will open a new window using RegisterClientScriptBlock


RegisterClientScriptBlock("", " window.open('popup.aspx','anycontent','width=300, height=300,left=100,top=150,status=no, location=no'); ")

Post Navigation

Follow

Get every new post delivered to your Inbox.