日期:2014-05-17 浏览次数:20571 次
<a href="#" id="idBoxOpen" style="text-decoration: none; color: #00CCFF">私信</a></div>
<dl id="idBox" class="lightbox" style="top: 10%; left: 5%;">
<dd>
asp:Label ID="Label8" runat="server" Text="内容:"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="80px" TextMode="MultiLine" Width="250px"></asp:TextBox>
<br />
<asp:Button ID="sendmes" runat="server" Text="私信" />
</dd>
</dl>
<script type="text/javascript">
(function () {
var ab = new AlertBox("idBox"), lock = false;
$$("sendmes").onclick = function () {
"<%=sendmes_Onclik() %>";
ab.close();
}
$$("idBoxOpen").onclick = function () {
ab.center = true;
ab.show();
}
})()
</script>
$ (function () {
var ab = new AlertBox("idBox");
lock = false;
$("sendmes").click = function () {
//你的点击操作
}
});
------解决方案--------------------
button的事件放在button上,
<asp:Button ID="sendmes" runat="server" Text="私信" onclick="sendmes_Onclik" style="height: 21px" />
点击私信后就执行sendmes_Onclik中的内容了,不需js,还是按通常的思路比较好。
如果用到在执行sendmes_Onclik的过程中用到js,用asp.net中的js注册方法实现。
------解决方案--------------------
楼主是想用js调用后台方法吧
很简单你百度搜一下 __doPostBack吧,
然后你就明白了。
------解决方案--------------------
$$("sendmes").onclick = function () {
<%=Page.ClientScript.GetPostBackEventReference(this.Page, "")%>;
ab.close();
}