如何将 AJAX Modal Popup Extender 的模态弹出面板极右对齐?

How to align modal popup panel extreme right for AJAX Modal Popup Extender?

我在主子关系的子页面中使用 Ajax modalpopupextender 控件。我想将 modalpopup 极右对齐

<asp:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panel1" TargetControlID="btnShow"
        CancelControlID="btnClose" BackgroundCssClass="modalBackground">
    </asp:ModalPopupExtender>
    <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none; right: 0px !important;">
        This is an ASP.Net AJAX ModalPopupExtender Example<br />
        <asp:Button ID="btnClose" runat="server" Text="Close" />
    </asp:Panel>
    <script type="text/javascript">
        var id = null;
        function movePanel() {
            var pnl = $get("ContentPlaceHolder1_Panel1");
            if (pnl != null) {
                pnl.style.right = "0px !important";
                pnl.style.top = "0px";
                pnl.style.left = "none";
            }
        }
    </script>

我尝试过各种解决方案,其中一些在代码部分。根据我的作业,我尝试使用 X 和 Y ModalPopupExtender。但是 X 和 Y for 不允许像 x=100vw-width of panel;

这样的计算

请帮忙。

最后我it.I考虑了面板的长度=550px。

<input type="hidden" name="checkyear" id="checkyear" runat="server" value="" />
 <script>
        $(document).ready(function(){
            document.getElementById("ContentPlaceHolder1_checkyear").value = screen.width-550;
        });
</script>

//在代码后面

mp1.X = Convert.ToInt32(checkyear.Value);