繁体   English   中英

使用其中的按钮关闭radwindow

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM