-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefault15.aspx
More file actions
38 lines (32 loc) · 1.08 KB
/
Default15.aspx
File metadata and controls
38 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default15.aspx.cs" Inherits="Default15" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
// <![CDATA[
function Button1_onclick() {
var ar = new Array;
ar[0] = 9;
ar[1] = 7;
ar[2] = 1;
ar[3] = 4;
ar[4] = 5;
var sum = 0;
for (var x = 0; x < 5; x++)
sum = sum + ar[x];
document.getElementById("Text1").value = sum;
document.getElementById("Text2").value = (sum/5);
}
// ]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /><br />
<input id="Text1" type="text" /><br />
<input id="Text2" type="text" /></div>
</form>
</body>
</html>