Celsius to Fahrenheit Converter in asp.net C#
Conversion Formula:
C/5 = F-32/9
Celsius TextBox change Event handler.
protected void txtCelsius_TextChanged(object sender, EventArgs e)
{
Decimal outputCelsius;
Decimal.TryParse(txtCelsius.Text, out outputCelsius);
txtFarenheit.Text = String.Format("{0:F2}", ((outputCelsius/5)*9)+32);
}
{
Decimal outputCelsius;
Decimal.TryParse(txtCelsius.Text, out outputCelsius);
txtFarenheit.Text = String.Format("{0:F2}", ((outputCelsius/5)*9)+32);
}
Fareinheat TextBox Change Event handler.
protected void txtFarenheit_TextChanged(object sender, EventArgs e)
{
//calendardemo / 5 = false - 32 / 9;
Decimal outputFarein;
Decimal.TryParse(txtFarenheit.Text, out outputFarein);
txtCelsius.Text = String.Format("{0:F2}", (((outputFarein - 32) / 9) * 5));
}
{
//calendardemo / 5 = false - 32 / 9;
Decimal outputFarein;
Decimal.TryParse(txtFarenheit.Text, out outputFarein);
txtCelsius.Text = String.Format("{0:F2}", (((outputFarein - 32) / 9) * 5));
}
OUTPUT:
Tags:Celsius to Fahrenheit Converter in asp.net C#,Farenheit to Celsius converter in asp.net,Textbox Autopostback,Textbox Textchange event handler,
No comments:
Post a Comment