从C#后台输出JS代码
2013-01-31 08:36
295 查看
// 这里是主表输出是 自定义表格格式函数 private bool bSwitch = false; string color1 = "#ffffcc"; string color2 = "#ccff99"; /// <summary> /// 定义搜索后列表 主表样式输出 /// </summary> /// <param name="con"></param> /// <returns></returns> public string TRJavaScript(Control con) { string tmp; DataListItem dli = con as DataListItem; Button btn = dli.FindControl("HiddenButton") as Button; string _js = "bgcolor={0} onMouseover='rowcolor=this" + ".style.backgroundColor;this.style.backgroundColor" + "=\"#00FF28\"; this.style.cursor = \"hand\"' " + "onMouseout='this.style.backgroundColor=rowcolor;' " + " onclick='document.getElementById(\"{1}\").click();' "; tmp = bSwitch ? string.Format(_js, color1, btn.ClientID) : string.Format(_js, color2, btn.ClientID); bSwitch = !bSwitch; return tmp; }
相关文章推荐
- JS调用C#后台代码---JS实现DataGrid“全选”、“反选”、调用后台代码批量删除数据
- asp.net对cookie的操作(前台js和后台c#代码)
- 根据JS判断是否执行C#后台代码(后台弹出确定/取消提示窗口)
- C#【js利用ajax去访问后台代码】
- C#向前台页面中输出JS代码 .
- C# 后台调用前台的JS方法 以及常用的代码片断
- c# 前台js 调用后台代码
- asp.net js与后台C#代码相互调用
- C#前台js调用后台代码
- 牛腩购物9 用户表设计/动软生成器/金钱字段decimal(18, 2)/ 注册的时候的前台js判断/后台代码判断/正则表达式软件/RegexBuddy/设置数据库字段的唯一性约束/如何获取控件在前台html的id值/如何将C#的后台正则换成js的正则
- ASP.NET后台输出js脚本代码
- ie窗口之间的无刷新传参数,c#后台代码调用前台js代码
- C#向前台页面中输出JS代码
- JS执行C#后台代码
- c# 后台代码注册 js 脚本并执行
- 在C#代码(后台aspx.cs)页面中实现js的alert功能
- C#winform后台代码与HTML内JS脚本函数相互调用
- JS调用C#后台代码---JS实现DataGrid“全选”、“反选”、调用后台代码批量删除数据
- JS调用C#后台代码---JS实现DataGrid“全选”、“反选”、调用后台代码批量删除数据
- C#前台js调用后台代码和后台代码调用前台js