-
Notifications
You must be signed in to change notification settings - Fork 0
/
User_Calc.aspx
99 lines (97 loc) · 5.13 KB
/
User_Calc.aspx
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="User_Calc.aspx.cs" Inherits="Default2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<%-- Her linker vi til koden - så siden kan se det(ligesom stylesheetet) --%>
<link href="norm_calc/norm_calc_style.css" rel="stylesheet" />
<script src="norm_calc/norm_calc.js"></script>
<script type="text/javascript">
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h4>Dette er calc</h4>
<asp:Label ID="Calc_Label" runat="server" Text=""></asp:Label>
<br />
<form action="">
<table class="calculator" id="calc">
<tr>
<td colspan="4" class="calc_td_result">
<input type="text" readonly="readonly" name="calc_result" id="calc_result" class="calc_result" onkeydown="javascript:key_detect_calc('calc',event);" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="CE" onclick="javascript: f_calc('calc', 'ce');" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="←" onclick="javascript: f_calc('calc', 'nbs');" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="%" onclick="javascript: f_calc('calc', '%');" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="+" onclick="javascript: f_calc('calc', '+');" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="7" onclick="javascript: add_calc('calc', 7);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="8" onclick="javascript: add_calc('calc', 8);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="9" onclick="javascript: add_calc('calc', 9);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="-" onclick="javascript: f_calc('calc', '-');" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="4" onclick="javascript: add_calc('calc', 4);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="5" onclick="javascript: add_calc('calc', 5);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="6" onclick="javascript: add_calc('calc', 6);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="x" onclick="javascript: f_calc('calc', '*');" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="1" onclick="javascript: add_calc('calc', 1);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="2" onclick="javascript: add_calc('calc', 2);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="3" onclick="javascript: add_calc('calc', 3);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="÷" onclick="javascript: f_calc('calc', '');" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="0" onclick="javascript: add_calc('calc', 0);" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="±" onclick="javascript: f_calc('calc', '+-');" />
</td>
<td class="calc_td_btn">
<input type="button" class="calc_btn" value="," onclick="javascript: add_calc('calc', '.');" />
</td>
<td class="calc_td_btn">
<input id="calcsum" type="button" class="calc_btn" value="=" onclick="javascript: f_calc('calc', '=');" />
</td>
</tr>
</table>
<%-- Her kaldes lommeregner funktionen --%>
<script type="text/javascript">
document.getElementById('calc').onload = init_calc('calc');
</script>
</form>
<asp:Button CssClass="button" OnClientClick="" UseSubmitBehavior="false" ID="logoff_calc" runat="server" Text="Log af" OnClick="logoff_calc_Click" />
</asp:Content>