RadControls version: v.2010.3.1109.35 |
|
.NET version: Any |
|
Visual Studio version: Any |
|
programming language: Any |
|
browser support |
all browsers supported by RadControls
|
PROJECT DESCRIPTION
The new RadButton is really cool and highly configurable. One of the ButtonTypes available is the LinkButton. I'm using several of the new buttons on a site and I need one to open a link in a new browser window with a custom size. Note that if you don't care about the size of the new window, you can just set the Target = "_blank". This project shows how to open a new browser window with custom features.
- Set the ButtonType to LinkButton.
- Set the NavigateUrl to the desired URL.
- Set the OnClientClicking property to the name of your JavaScript function. No parameters or references need to be passed inside parentheses. Telerik already took care of that for you. Note that you can't use the "OnClientClicked" property because it is not cancellable.
The .aspx Markup:
- Pass the desired URL and your custom requirements to the window.open function. The NavigateUrl value is available as "sender._navigateUrl".
- Cancel the click event. If you don't cancel the event the main window will navigate to the new URL too. "return false" works with IE, but args.set_cancel(true) works with all supported browsers.
The JavaScript:
Pretty simple. But it took me a while to figure out all the details, so hopefully this will help speed someone else's development!