|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
return a string from asp.net component
I am having a problem with returning a string from a component I wrote.. For example I can create this simple component and return a integer fine.<br><br><br>Imports system<br><br><br>Public Class retrnNames <br><br> dim strname1 as string<br> dim count1 as integer<br> Public function myname() as Integer<br> count1 = 150<br> return count1<br> end function<br> <br>end class<br><br><br>However if I try to return a string I get a error...(Input string was not in a correct format.)<br><br>Imports system<br><br><br>Public Class retrnNames <br><br> dim strname1 as string<br> dim count1 as integer<br> Public function myname() as string<br> strname1 = "Help!"<br> return strname1 <br> end function<br> <br>end class<br><br><br>Does anyone have any idea why I get this error??!??
|
|
#2
|
|||
|
|||
|
Is the code u gave to us exactly same as ur code?<br>I couldn't see any error in the sample u gave. <br><br>It looks like u are trying to get string from control or database by looking at error message.<br><br>Sorry cant help u much
|
|
#3
|
|||
|
|||
|
Thanks for your reply but I found the problem and I felt real dumb when I did. In the aspx file that I was using to call my component, I had not declared the variable as a string. I could have sworn I had checked that several times.
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > return a string from asp.net component |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|