.net中函数的使用实例
2005-03-16 13:00
423 查看
<%@ Page Language="c#" %>
<script runat="server">
string Global ="<br><u>Hello I'm a persistent global variable</u>";
void Page_Load()
{
message1.Text="";
message1.Text+= Global;
message1.Text+="<BR />Calling Function 1...";
Function1();
message1.Text+="<BR />Calling Function 2...";
Function2();
message1.Text+="<BR />Calling Function 1...";
Function1();
}
void Function1()
{
string Different = "<i>Hello I'm the variable Different in Function 1</i>";
message1.Text+= Different;
message1.Text+= Global;
}
void Function2()
{
string Different = "<b>Hello I'm the variable Different in Function 2</b>";
message1.Text+= Different;
message1.Text+= Global;
}
</script>
<html>
<head>
<title>Scope</title>
</head>
<body>
<asp:Label id="message1" runat="server"></asp:Label>
</body>
</html>
<script runat="server">
string Global ="<br><u>Hello I'm a persistent global variable</u>";
void Page_Load()
{
message1.Text="";
message1.Text+= Global;
message1.Text+="<BR />Calling Function 1...";
Function1();
message1.Text+="<BR />Calling Function 2...";
Function2();
message1.Text+="<BR />Calling Function 1...";
Function1();
}
void Function1()
{
string Different = "<i>Hello I'm the variable Different in Function 1</i>";
message1.Text+= Different;
message1.Text+= Global;
}
void Function2()
{
string Different = "<b>Hello I'm the variable Different in Function 2</b>";
message1.Text+= Different;
message1.Text+= Global;
}
</script>
<html>
<head>
<title>Scope</title>
</head>
<body>
<asp:Label id="message1" runat="server"></asp:Label>
</body>
</html>
相关文章推荐
- 实例讲解.NET中资源文件的创建与使用
- PHP图片处理之使用imagecopy函数添加图片水印实例
- String.Split()函数 多种使用实例
- echarts在.Net中使用实例(一) 简单的Demo
- 使用W“.NET技术”CF实现SOA面向服务编程——简单的WCF开发实例
- echarts在.Net中使用实例(一) 简单的Demo
- 虚函数使用实例
- 实例讲解.NET中资源文件的创建与使用
- 实例讲解.NET中资源文件的创建与使用
- .net中使用反射实例:操作非公有成员
- 使用python装饰器计算函数运行时间的实例
- Response. AppendHeader使用大全及文件下载.net函数使用注意点(转载)
- SQL Server中调用C#类中的方法实例(使用.NET程序集)
- php explode() 函数的基本语法及使用实例
- .net使用自定义类属性实例
- Linux 在Shell脚本中使用函数实例详解
- Codeigniter常用类库及辅助函数使用实例
- 使用scatter与random.normal函数绘制散点图简单实例
- Sql Server 开窗函数Over()的使用实例详解
- MySQL中文汉字转拼音的自定义函数和使用实例(首字的首字母)