码迷,mamicode.com
首页 > Web开发 > 详细

asp:UpdatePanel中js失效问题已解决

时间:2015-05-11 21:30:39      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:

 

1.js

function textSAll(o) {
o.select();
}
var dddd_dd = function () {
$(":text").on("click", function () {
textSAll(this);
});
};
$(function () {
dddd_dd();
});
$(function () {
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
dddd_dd();

});
});

2.关于div信息提示框,后台重新注册js事件的

protected void resizePageJS()
{
Random Rdm = new Random();
long m = DateTime.Now.ToFileTimeUtc();
int r = Rdm.Next(1, Int32.MaxValue);
try
{
if (!string.IsNullOrEmpty(Message))
{
ScriptManager.RegisterStartupScript(updatePanel_page, this.Page.GetType(), m + "_" + r, "showErrorMsg(\"" + Message + "\");hideLoading();", true);
//ScriptManager.RegisterStartupScript(updatePanel_page, this.Page.GetType(), m + "_" + r, "setpadleft();showErrorMsg(‘" + Message + "‘);hideLoading();", true);
}
else
{
ScriptManager.RegisterStartupScript(updatePanel_page, this.Page.GetType(), m + "_" + r, "setpadleft(); hideLoading();", true);
}
}
catch (Exception e) { }
}

信息提示框

<div class="modal fade" id="MessageModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><i class="glyphicon glyphicon-info-sign"></i>
信息提示</h4>
</div>
<div class="modal-body text-center">
<p class="text-danger"><span id="errorMsg"></span></p>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">确认</button>
</div>
</div>
</div>
</div>

后台cs

public string Message
{
set;
get;
}

 

asp:UpdatePanel中js失效问题已解决

标签:

原文地址:http://www.cnblogs.com/ctautocn/p/4495414.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!