0

I am trying to set content of thickbox in jquery as I want to take content from server. I am using following code in clientside:

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

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

              });                
            }

How do I show it in my thickbox?

Thanks in advance...

4

1 回答 1

0

Thickbox 具有通过 AJAX 显示内容的内置方式。如果您想将您的 Url Action 放在那里,您可以这样做。

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

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

于 2013-06-14T16:35:23.670 回答