| | |
Using VB.Net 2008 to convert from ASP.NET 2005
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Sep 2008
Posts: 27
Reputation:
Solved Threads: 0
I am studying VB.NET in a VB 2005 book, but using VB 2008. What is wrong with this code? I am using ASP.NET to write a web page. For each reference to:
ResultFahrenheit.Text
ResultCelsius.Text
ResultKelvin.Text
I get errors that say:
Name 'ResultFahrenheit' is not declared.
Name 'ResultCelsius' is not declared.
Name 'ResultKelvin' is not declared.
Each of these fields is a cell in a table. I tried naming the table to 'table1', then adding:
table1.ResultFahrenheit...
This took the error away from 'ResultFahrenheit', but put it on 'table1'. So, apparently the 'ResultFahrenheit' needs some type of prefix.
I'd appreciate any suggestions.
Thanks
ResultFahrenheit.Text
ResultCelsius.Text
ResultKelvin.Text
I get errors that say:
Name 'ResultFahrenheit' is not declared.
Name 'ResultCelsius' is not declared.
Name 'ResultKelvin' is not declared.
Each of these fields is a cell in a table. I tried naming the table to 'table1', then adding:
table1.ResultFahrenheit...
This took the error away from 'ResultFahrenheit', but put it on 'table1'. So, apparently the 'ResultFahrenheit' needs some type of prefix.
I'd appreciate any suggestions.
Thanks
VB.NET Syntax (Toggle Plain Text)
' ----- The conversion occurs here. Dim origValue As Double If (IsNumeric(SourceValue.Text) = True) Then ' ----- The user supplied a number. Convert it. origValue = CDbl(SourceValue.Text) If (SourceType.SelectedValue = "F") Then ' ----- From Fahrenheit. ResultFahrenheit.Text = CStr(origValue) ResultCelsius.Text = CStr((origValue - 32) / 1.8) ResultKelvin.Text = CStr(((origValue - 32) / 1.8) + _ 273.15) ElseIf (SourceType.SelectedValue = "C") Then ' ----- From Celsius. ResultFahrenheit.Text = CStr((origValue * 1.8) + 32) ResultCelsius.Text = CStr(origValue) ResultKelvin.Text = CStr(origValue + 273.15) Else ' ----- From kelvin. ResultFahrenheit.Text = CStr(((origValue - 273.15) * _ 1.8) + 32) ResultCelsius.Text = CStr(origValue - 273.15) ResultKelvin.Text = CStr(origValue) End If Else ' ----- Unknown source value. ResultFahrenheit.Text = "???" ResultCelsius.Text = "???" ResultKelvin.Text = "???" End If
![]() |
Similar Threads
- Fake Windows Security Message (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access add application arithmetic array assignment basic box button buttons center check click code combo component connectionstring convert cpu crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net exists file-dialog firewall folder ftp hardcopy image images isnumericfuntioncall math mobile module mssqlbackend mysql navigate networking opacity output peertopeervideostreaming picturebox1 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left savedialog serial sqldatbase storedprocedure string tcp temp text textbox timer toolbox trim txttoxmlconverter updown useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml






