javascript在C#中的使用

来源:互联网 发布:mac安装的程序在哪 编辑:程序博客网 时间:2024/06/05 10:12
 

1.返回上一页
cancelpicinfo.Attributes.Add("onclick","javascript:history.back(-1);");
private void cancelpicinfo_Click(object sender, System.EventArgs e)
   {
       Response.Write("<script language=javascript>history.go(-1);</script>");
   }
两个要一起使用才行,不知道为什么.

2.从一个子框架跳到总框架
Response.Write("<script language=javascript>parent.location.href='login.aspx';</script>");

3.通过让js点击一个asp.net按纽的方法来调用C#
ListBox1.Attributes.Add("ondblclick","javascript:document.all.rtBtn1.click();");

原创粉丝点击