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