Script and C#

来源:互联网 发布:谷跃网络 编辑:程序博客网 时间:2024/05/16 10:28
 

第一种:

protected string getStr(){

return (www.sina.com.cn);

 

<scritp language="javascript">

var a=<%#getStr()%>;

document.write(a);

</script>

 

第二种:

protected void getStr()

{

response.write(www.sina.com.cn);

}

<script language="javascript">

document.write("<%getStr();%>");

</script>