title: Closing RadWindow using RadButton
body: <p>I'm trying to use a RadButton to close a radwindow from with the window itself (via javascript). Is it possible to call a script to close the window? Here is the javascript:</p>
  
  <pre class="lang-js prettyprint-override"><code>function getRadWindow() 
  {
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
  }
  
  function closeWindow() 
  {
    getRadWindow().close();
  }
  </code></pre>
  
  <p>And here is the button:</p>
  
  <pre><code>&lt;telerik:RadButton ID="CancelButton" runat="server" OnClick="closeWindow();" CssClass="clicker" Text="Cancel" UseSubmitBehavior="False" EnableEmbeddedScripts="false" CausesValidation="False" RegisterWithScriptManager="False"&gt;
  &lt;/telerik:RadButton&gt;
  </code></pre>
  
  <p>I have tried everything, the script will only work if I use a pure HTML element such as an anchor tag. If I use the OnClick event I get the following error when the window opens: <code>Compiler Error Message: CS1026: ) expected.</code> </p>
  
  <p>Am I missing something?</p>
  
  <p>Thanks!</p>