ASP.NET和JavaScript传值

  • 传变量值:

html js中

var srcUrl = <%=getUrl%>;


cs类文件中

public static string getUrl = "http://www.123.com/";

 

  • 传方法值:

html js中

var srcUrl = <%=getUrl()%>;

 


cs类文件中

public static string getUrl()
{
        return  "http://www.123.com/";
}


http://heisetoufa.iteye.com/

posted @ 2012-10-24 12:14  isMethod  阅读(106)  评论(0编辑  收藏  举报