Telerik RadWindowManager
I use Telerik radWindowManager to display alert windows. I have code like this:
<telerik:RadWindowManager ID="window1" runat="server" ReloadOnShow="true"
EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" OnClientClose="javascript:alert('test')">
...
</telerik:RadWindowManager>
The problem is when I use this code without "OnClientClose" it works fine but when I add "OnClientClose" the alert i开发者_开发知识库s not displayed.
Thanks.
The OnClientClose attribute takes pointer to a JS method, not a call.
Which is why Nima M's solution works
From the Telerik website, RadControls for ASP.NET AJAX > Documentation > Client-Side Events:
The RadWindow control has a number of properties whose value is the name of a javascript function that executes when specific client-side events occur.
That is, not inline JavaScript. The equivalent properties on the RadWindowManager
class work the same way.
You can probably write a separate method to handle OnClientClose:
<telerik:RadWindowManager ID="window1" runat="server" ReloadOnShow="true"
EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" OnClientClose="OnClientCloseHandler">
...
</telerik:RadWindowManager>
<telerik:RadCodeBlock ID="rcbModal" runat="server">
<script language="javascript" type="text/javascript">
function OnClientCloseHandler(radWindow) {
//Do Domething Here
}
</script>
</telerik:RadCodeBlock>
精彩评论