当前位置: 代码迷 >> 综合 >> asp.net后台与前台的互相调用
  详细解决方案

asp.net后台与前台的互相调用

热度:23   发布时间:2024-01-15 23:55:02.0

一.后台调用前台

1.Page.ClientScript.RegisterStartupScript(type,"",script);

例:

string script = string.Format("<script>alert('Wrong');</script>");
Page.ClientScript.RegisterStartupScript(GetType(), "Load", script);

 

2.对象.Attributes.Add("事件","script")

例:

e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#ECECFF'");

 

 

二.前台调用后台

1.一般没有必要在html文件里调用cs文件.

 

  相关解决方案