| | |
Using VB.Net 2008 to convert from ASP.NET 2005
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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 |
.net .net2008 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic excel exists fade filter forms generatetags gridview html images input insert intel internet listview map mobile module monitor msaccess net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey table temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year






