张银的博客


Eat to live, but do not live to eat.

导航

.NET后台调用JS前台

Posted on 2009-02-18 09:31  张银  阅读(1440)  评论(0编辑  收藏  举报

调用前台变量
方法一:1、前台使用静态文本控件隐藏域,将js变量值写入其中;2、后台用request["id"]来获取值;
方法二:可以用cookie或session

调用前台函数
方法一:

Page.RegisterStartupScript("ggg"," ");

方法二:使用Literal类,然后

private void Button2_Click(object sender, System.EventArgs e) 

  
string str; 
  str
=" "
  
//Literal1.Visible=true; 
  Literal1.Text=str; 
}

网上找来的资料,偶看的不是很明白
希望大家能提供些相关的资料,比如说.NET调用JS函数变量还有什么其他方法,或者介绍Literal类的知识也行,谢了!