C#后台调用前台js方法
前台js方法(写在head标签之内)
<script type="text/javascript" language="javascript"> function Close() { document.getElementById("doing").style.display = "none"; document.getElementById("divLogin").style.display = "none"; } </script>
后台方法。我选用的是一个LinkButton
protected void LinkButton2_Click(object sender, EventArgs e) { int count = 0; for (int i = 0; i <= GridView1.Rows.Count - 1; i++) { CheckBox cbox = (CheckBox)GridView1.Rows[i].FindControl("cbSelect"); if (cbox.Checked == true) { count++; } } if (count == 0) { ScriptManager.RegisterStartupScript(this.UpdatePanel2, this.UpdatePanel2.GetType(), "Alert", "alert('请至少选择一个物资!')", true); return; } else { //调用前台的 Close() 方法 ClientScriptManager cs = Page.ClientScript; cs.RegisterStartupScript(this.GetType(), "", "<script type=\"text/javascript\">Close() ;</script>"); }
C#后台调用前台js方法的更多相关文章
- 后台调用前台js方法
后台调用前台jsClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<s ...
- .NET网页后台调用前台js方法时相同Key,调用不成功
ClientScript.RegisterStartupScript(GetType(), "key", "<script>Save()</script ...
- js调用.net后台事件,和后台调用前台等方法总结(转帖)
js调用.net后台事件,和后台调用前台等方法总结 原文来自:http://hi.baidu.com/xiaowei0705/blog/item/4d56163f5e4bf616bba16725.ht ...
- js调用.net后台事件,和后台调用前台等方法以及js调用服务器控件的方法
http://blog.csdn.net/deepwishly/article/details/6670942 ajaxPro.dll基础教程(前台调用后台方法,后台调用前台方法) 1. javaS ...
- 后台调用前台js
WEB后台代码调用前台JS(两种方式). 1 这种方式只能调用简单的JS代码.不能调用自定义的函数. string jss = "<script language='javascr ...
- js调用后台,后台调用前台等方法总结
1. javaScript函数中执行C#代码中的函数:方法一:1.首先建立一个按钮,在后台将调用或处理的内容写入button_click中; 2.在前台写一个js函数,内容为docume ...
- ASP.NET后台调用前台JS函数的三种常见方法
第一种:使用普通的添加控件中的Attributes属性进行调用 例如,像一般的普通的按钮:Button1.Attributes.Add("onclick","MyFun( ...
- asp.net后台调用前台js代码
为了通过ajax异步获取数据,我通过使用jquery的$(function{})方法,在页面加载时发送ajax请求,获取相关的数据.但是遇到了一个问题,当我发送的ajax请求需要根据传过来的URL参数 ...
- C# 后台调用前台JS
1.需要添加微软的类库 Interop.MSScriptControl.dll 2. var path = Path.GetFullPath("../../javascript/youzi ...
随机推荐
- 洛谷——P1774 最接近神的人_NOI导刊2010提高(02)
https://www.luogu.org/problem/show?pid=1774 题目描述 破解了符文之语,小FF开启了通往地下的道路.当他走到最底层时,发现正前方有一扇巨石门,门上雕刻着一幅古 ...
- 定制表格头, 学习Core Graphic 的第二部分, 阴影与玻璃效果.
//定制表格头, 学习Core Graphic 的第二部分, 阴影与玻璃效果. https://github.com/comcuter/testsnippets/commit/e96f62d115ef ...
- [Angular] Omit relative path by set up in tsconfig.json
For example, inside you component you want to import a file from two up directory: import store from ...
- 9.13 Binder系统_Java实现_内部机制_Server端
logcat TestServer:* TestClient:* HelloService:* *:S &CLASSPATH=/mnt/android_fs/TestServer.jar ap ...
- 键盘钩子监测按键后,获取键码及按键名称(MFC)
LRESULT CALLBACK LowLevelKeyboardProc(int nCode,WPARAM wParam,LPARAM lParam){ if(nCode ==HC_ACTION & ...
- [Angular2 Animation] Control Undefined Angular 2 States with void State
Each trigger starts with an “undefined” state or a “void” state which doesn’t match any of your curr ...
- 使用DatagramSocket与DatagramPacket传输数据 分类: B1_JAVA 2013-10-12 13:00 1936人阅读 评论(0) 收藏
参考传智播客毕向东JAVA视频. 注: DatagramSocket发送的每个包都需要指定地址,而Socket则是在首次创建时指定地址,以后所有数据的发送都通过此socket. A socket is ...
- 微信小程序初步运营方案
小程序的运营方案有很多种,目前我们遇到两个事情需要解决:1.问答的内容,这块也是大家比较关心的话题.内容的定位和细节. 2.预热与推广,就这两个问题,我列出了一些自己的想法和小程序初步运营方案,有不足 ...
- linux中竖线'|',双竖线‘||’,&和&&的意思
对于初学者来说这几个意思可能只知道其中几个的意思,下面我们来看一下. 1.竖线'|' ,在linux中是作为管道符的,将'|'前面命令的输出作为'|'后面的输入.举个例子 [18066609@root ...
- [Docker] Create a Volume
We can create volumn to keep the data, even we stop the container and restart again, the data won't ...