webform将一个usercontrol作为模态框在page上d出

webform将一个usercontrol作为模态框在page上d出,第1张

概述d窗 public static void RegisterJQueryDialogScript(Page page, string dialogDivId, string title, int width, int height, bool autoOpen, string openTriggerClientId) { if (string.IsNul

d窗

public static voID RegisterJqueryDialogScript(Page page,string dialogdivID,string Title,int wIDth,int height,bool autoOpen,string openTriggerClIEntID)        {            if (string.IsNullOrEmpty(Title))                Title = "Form";            var heightStr = string.Empty;            var witdthStr = string.Empty;            if (height > 0)                heightStr = "height: " + height.ToString() + ",";            if (wIDth > 0)                witdthStr = "wIDth: " + wIDth.ToString() + ",";            string script = @"$(function (){    $(‘#dialog:ui-dialog‘).dialog(‘destroy‘);    $(‘#" + dialogdivID + @"‘).dialog(        {            Title: ‘" + Title + @"‘,autoOpen:" + autoOpen.ToString().Tolower() + "," +            heightStr +            witdthStr + @"            closeText: ‘No‘,modal: true,resizable: false        }    ).parent().appendTo(‘form‘);});";            string scriptKey = "Open" + dialogdivID;            if (autoOpen)                ScriptManager.RegisterStartupScript(page,page.GetType(),scriptKey,script,true);            else            {                ScriptManager.RegisterClIEntScriptBlock(page,true);                var scriptTrigger = @"$(‘#" + openTriggerClIEntID + @"‘)                        .click(function () {                            $(‘#" + dialogdivID + @"‘).dialog(‘open‘);                            return false;                        });";                scriptKey += "Trigger";                ScriptManager.RegisterStartupScript(page,scriptTrigger,true);            }        }

 

Open a user control in a pop up 总结

以上是内存溢出为你收集整理的webform将一个usercontrol作为模态框在page上d出全部内容,希望文章能够帮你解决webform将一个usercontrol作为模态框在page上d出所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1079728.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存