Hello Keith,
Here is a small example I made with your case:
<script type="text/javascript"> |
function openRadWindow(e) |
{ |
//open radwindow here |
alert(1); |
$telerik.cancelRawEvent(e); |
} |
</script> |
|
<telerik:RadRotator DataSourceID="XmlDataSource1" ID="RadRotator1" runat="server" |
ItemWidth="300px" Width="300px" ItemHeight="300px" Height="300px"> |
<ItemTemplate> |
<asp:LinkButton ID="linkButton1" runat="Server"> |
<img src='<%# XPath("Image") %>' alt=""/> |
<%# XPath("Text") %> |
</asp:LinkButton> |
<asp:LinkButton ID="linkButton2" OnClientClick="openRadWindow(event);return false" |
runat="Server">Test window open</asp:LinkButton> |
</ItemTemplate> |
</telerik:RadRotator> |
The example features a rotator with two link buttons in the item template. One of the link buttons posts back to the server, while the other opens a new window without posting back. In this case you do not need a rotator ItemClick event, because both the image and the text are included in the first link button - clicking either of them will initiate a postback from the link button.
The second link button does not postback. I have achieved this by adding "return false;" after the function call in the OnClientClick property and by canceling the event bubbling using one of our client-side API functions (cancelRawEvent).
If you add an ItemClick event with the above rotator configuration here is what will happen:
- clicking on the first link button (image or text) will produce two postbacks - one for the rotator item click event and one for the link button.
- clicking on the second link button (window open) will not make a postback because we cancel the event bubbling up to the rotator item.
If you still experience problems after using the above example, please open a formal support ticket and send us a sample project and tell us what you think is wrong with it. We will do our best to help you fix it.
Kind regards,
Lini
the Telerik team
Check out
Telerik Trainer, the state of the art learning tool for Telerik products.