-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathozAlitros.aspx.cs
More file actions
35 lines (31 loc) · 820 Bytes
/
ozAlitros.aspx.cs
File metadata and controls
35 lines (31 loc) · 820 Bytes
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Conversor
{
public partial class ozAlitros : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (double.TryParse(TextBox1.Text, out double onzas))
{
double litros = onzas * 0.0295735;
TextBox2.Text = litros.ToString("F4");
}
else
{
TextBox2.Text = "Error";
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("Inicio.aspx");
}
}
}