用thickbox弹出一个层 ,该层上有Button 怎样触发它的后台OnClick 事件?
这是个让我很纠结的问题。原本以为thickbox功能相当的强大,可是这么个问题出来以后让我对thickbox大失所望,目前寻找解决方案,我在网搜刮了N久,有人遇到同样的问题,但是都没有很好的解决方案,小弟现在想CSDN的同僚们求救。
我先上代码:
<button id="lbtsk_addbid" class="thickbox" alt="#TB_inline?height=100&width=160&inlineId=addbid" >点我</button>
<div id="addition" style=" padding: 10px;"> <asp:Button ID="Button1" runat="server" Text="Button"/></div>
//按钮的后台的代码 protected void Button1_Click(object sender, EventArgs e) { Response.Write("<script>alert('sadf')</script>"); }if(url.indexOf('TB_inline') != -1){ $("#TB_ajaxContent").append($('#' + params['inlineId']).children()); $("#TB_window").unload(function () { $('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished }); tb_position(); $("#TB_load").remove(); $("#TB_window").css({display:"block"}); }
a.aspx
<SCRIPT src="../js/jquery-latest.pack.js" type=text/javascript></SCRIPT>
<script>
function CloseClientJWindow(result, isInIFrame)
{
var p = null;
if(isInIFrame)
{
p = self.parent;
if(p == null) return;
}
else
{
p = self;
}
p.jWindow.close(p.$('#openwin'),result);
}
</script>
[解决办法]
&inlineId=addbid&modal=true试试
参考