[英]Close radwindow using button inside it
我每頁都有一個彈出窗口。 我想使用其中的關閉按鈕關閉彈出窗口。 我已經在網上搜索過,但是沒有任何運氣。 誰能幫我?
這是我的代碼: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>
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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.