博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
asp:UpdatePanel中js失效问题已解决
阅读量:4625 次
发布时间:2019-06-09

本文共 1627 字,大约阅读时间需要 5 分钟。

 

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;
}

 

转载于:https://www.cnblogs.com/ctautocn/p/4495414.html

你可能感兴趣的文章
也谈智能手机游戏开发中的分辨率自适应问题
查看>>
关于 IOS 发布的点点滴滴记录(一)
查看>>
《EMCAScript6入门》读书笔记——14.Promise对象
查看>>
CSS——水平/垂直居中
查看>>
Eclipse连接mysql数据库jdbc下载(图文)
查看>>
Python中Selenium的使用方法
查看>>
三月23日测试Fiddler
查看>>
20171013_数据库新环境后期操作
查看>>
SpringMVC中文件的上传(上传到服务器)和下载问题(二)--------下载
查看>>
Socket & TCP &HTTP
查看>>
osip及eXosip的编译方法
查看>>
Hibernate composite key
查看>>
[CF Round #294 div2] D. A and B and Interesting Substrings 【Map】
查看>>
keepalived+nginx安装配置
查看>>
我的2015---找寻真实的自己
查看>>
android编译遇到问题修改
查看>>
解决Ubuntu18.04.2远程桌面Xrdp登录蓝屏问题
查看>>
Git的安装和使用教程详解
查看>>
lsof命令详解
查看>>
常用模块,异常处理
查看>>