2017-08-02 2 views
0

私はすべてのページにポップアップradwindowを持っています。私はそれの中の閉じるボタンを使用してポップアップを閉じたいです。私はウェブで検索しましたが、運が得られませんでした。誰でも助けてくれますか?ここでRadwindowを閉じるには、ボタンを使用してください。

は私のコードです: Mainpage.aspx

<%@ Register TagPrefix="uc" TagName="ReportDialog" Src="~/WebUserControl/ReportDialog.ascx" %> 
<telerik:RadWindow ID="RadWindowReportDialog" runat="server" VisibleTitlebar="true" 
    Title="Report" VisibleStatusbar="false" Width="415px" Height="355px" ReloadOnShow="true" 
    ShowContentDuringLoad="true" Behaviors="Move, Close" Modal="true" OnClientBeforeClose="RadWindowReportDialog_OnClientBeforeClose"> 
    <ContentTemplate> 
     <uc:ReportDialog ID="ReportDialog" runat="server" /> 
    </ContentTemplate> 
</telerik:RadWindow> 

ReportDialog.ascx

<telerik:RadButton ID="btnClose" runat="server" CssClass="rbutton" OnClick="btnClose_Click" 
          Text="Close" Width="90px" OnClientLoad="btnClose_OnClientLoad" > 
          <Icon PrimaryIconUrl="../Image/Close.png" PrimaryIconLeft="4" PrimaryIconTop="4" /> 
         </telerik:RadButton> 

答えて

1

ASCX

<telerik:RadButton ID="btnClose" runat="server" CssClass="rbutton" OnClick="btnClose_Click" 
          Text="Close" Width="90px" OnClientLoad="btnClose_OnClientLoad" > 
          <Icon PrimaryIconUrl="../Image/Close.png" PrimaryIconLeft="4" PrimaryIconTop="4" OnClientClicked="OnClientClicked"/> 
         </telerik:RadButton> 

JS

<script type="text/javascript"> 
    function OnClientClicked(sender, args) { 
     var window= $find('<%=RadWindowReportDialog.ClientID %>'); 
     window.close(); 
    } 
</script> 
+0

上記のコードを試しましたが、このエラーが出ましたコンパイラエラーメッセージ:CS0103: 'RadWindowReportDialog'という名前は現在のコンテキストに存在しません – geekypanda

関連する問題