如何在jQuery中设置thickbox的内容?

时间:2013-06-14 12:41:46

标签: jquery ajax asp.net-mvc thickbox

我正在尝试在jquery中设置thickbox的内容,因为我想从服务器获取内容。我在客户端使用以下代码:

            function ShowEditForm(id) {
               $.ajax({
                 type: 'POST',
                 url: '@Url.Action("ActionMethod", "Controller")'                        
               }).done(function (html) {

                 //I am getting my html here
                 alert(html);

              });                
            }

如何在我的厚盒中显示它?

提前致谢...

1 个答案:

答案 0 :(得分:0)

Thickbox具有通过AJAX显示内容的内置方式。如果你想在那里获得你的网址操作,你可以这样做。

<a href="@Url.Action("ActionMethod", "Controller")?height=200&width=300" title="My Ajax Content" class="thickbox">My link</a>

我查看了他们的源代码,我没有看到任何回调,可以轻松地将HTML响应插入打开的窗口。