title: Visual Basic Temperature Converter
body: <p>I am new with Visual Basic and I am creating a aspx temperature converter application in Visual Studio 2010 where the user is able to input numbers into a textbox, choose what type temperature it is through a dropdown listbox, and choose what temperature to convert it to from a radio button list. The problem I am having is that I am getting an error when I try convertingrr something. I get the error "Input string was not in a correct format" and "Conversion from string "F" to type 'Boolean' is not valid." I've tried doing nested if..elseif..endif statements, but when I do that it just converts the 1st if statement and nothing else. Here is the code I have written for the conversion. Any help with this would be greatly appreciated. Thank You.</p>
  
  <pre><code> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
      If (DropDownList1.SelectedValue = "F" &amp; RadioButtonList1.SelectedValue = "F") Then
          Label1.Text = TextBox1.Text &amp; "Fahrenheit=" &amp; TextBox1.Text &amp; "Fahrenheit"
  
      ElseIf (DropDownList1.SelectedValue = "F" &amp; RadioButtonList1.SelectedValue = "C") Then
          Label1.Text = TextBox1.Text &amp; "Fahrenheit=" &amp; (TextBox1.Text * 1.8) + 32 &amp; " Celsius"
  
      ElseIf (DropDownList1.SelectedValue = "F" &amp; RadioButtonList1.SelectedValue = "K") Then
          Label1.Text = TextBox1.Text &amp; "Fahrenheit=" &amp; ((5 / 9) * (TextBox1.Text - 32) + 273) &amp; " Kelvin"
  
      ElseIf (DropDownList1.SelectedValue = "C" &amp; RadioButtonList1.SelectedValue = "C") Then
          Label1.Text = TextBox1.Text &amp; "Celsius=" &amp; TextBox1.Text &amp; "Celsius"
  
      ElseIf (DropDownList1.SelectedValue = "C" &amp; RadioButtonList1.SelectedValue = "F") Then
          Label1.Text = TextBox1.Text &amp; " Celsius = " &amp; (TextBox1.Text - 32) / 1.8 &amp; " Fahrenheit"
  
      ElseIf (DropDownList1.SelectedValue = "C" &amp; RadioButtonList1.SelectedValue = "K") Then
          Label1.Text = TextBox1.Text &amp; " Celsius = " &amp; (TextBox1.Text + 273) &amp; " Kelvin"
  
      ElseIf (DropDownList1.SelectedValue = "K" &amp; RadioButtonList1.SelectedValue = "K") Then
          Label1.Text = TextBox1.Text &amp; "Kelvin=" &amp; TextBox1.Text &amp; "Kelvin"
  
      ElseIf (DropDownList1.SelectedValue = "K" &amp; RadioButtonList1.SelectedValue = "F") Then
          Label1.Text = TextBox1.Text &amp; "Kelvin=" &amp; ((TextBox1.Text - 273) * 1.8) + 32 &amp; "Fahrenheit"
  
      ElseIf (DropDownList1.SelectedValue = "K" &amp; RadioButtonList1.SelectedValue = "C") Then
          Label1.Text = TextBox1.Text &amp; "Kelvin=" &amp; (TextBox1.Text - 237) &amp; "Celsius"
  
  
  
      End If
  
  
  
  End Sub
  </code></pre>