C# 设置对话框上的大小

C# 设置对话框上的大小,c#,asp.net-mvc-3,dialog,C#,Asp.net Mvc 3,Dialog,我正在使用一个对话框,但是它的大小不正确。有什么方法可以改变它吗 <script type="text/javascript"> $.ajaxSetup({ cache: false }); $(document).ready(function () { $(".openDialog").live("click", function (e) { e.preventDefault();

我正在使用一个对话框,但是它的大小不正确。有什么方法可以改变它吗

     <script type="text/javascript">

     $.ajaxSetup({ cache: false });

     $(document).ready(function () {
         $(".openDialog").live("click", function (e) {
             e.preventDefault();


             $("<div></div>")
                .addClass("dialog")
                .attr("id", $(this)
                .attr("data-dialog-id"))
                .appendTo("body")
                .dialog({
                    title: $(this).attr("data-dialog-title"),
                    close: function () { $(this).remove() },

                    modal: true
                })

                .load(this.href);
         });

         $(".close").live("click", function (e) {
             e.preventDefault();
             $(this).closest(".dialog").dialog("close");
         });
     });
</script>

$.ajaxSetup({cache:false});
$(文档).ready(函数(){
$(“.openDialog”).live(“单击”,函数(e){
e、 预防默认值();
$("")
.addClass(“对话框”)
.attr(“id”,$(此)
.attr(“数据对话框id”))
.附件(“正文”)
.对话({
标题:$(this.attr(“数据对话框标题”),
关闭:函数(){$(this).remove()},
莫代尔:对
})
.load(this.href);
});
$(“.close”).live(“单击”),函数(e){
e、 预防默认值();
$(此).close(.dialog”).dialog(“关闭”);
});
});

从jquery文档中,您可以使用
宽度
高度

对话框的高度,以像素为单位。还需要指定“自动” 支持根据对话框内容调整对话框

对话框的宽度,以像素为单位

$.ajaxSetup({cache:false});
$(文档).ready(函数(){
$(“.openDialog”).live(“单击”,函数(e){
e、 预防默认值();
$("")
.addClass(“对话框”)
.attr(“id”,$(此)
.attr(“数据对话框id”))
.附件(“正文”)
.对话({
宽度:yourValueHere,//放置宽度
高度:yourValueHere,//放置高度
标题:$(this.attr(“数据对话框标题”),
关闭:函数(){$(this).remove()},
莫代尔:对
})
.dialog({height:
.dialog({height:
 $.ajaxSetup({ cache: false });

 $(document).ready(function () {
     $(".openDialog").live("click", function (e) {
         e.preventDefault();


         $("<div></div>")
            .addClass("dialog")
            .attr("id", $(this)
            .attr("data-dialog-id"))
            .appendTo("body")
            .dialog({
                width:yourValueHere,//Put width
                height:yourValueHere,//Put height
                title: $(this).attr("data-dialog-title"),
                close: function () { $(this).remove() },

                modal: true
            })