Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > System.Web.Services.WebMethod( Description:= ...)

Reply
Thread Tools

System.Web.Services.WebMethod( Description:= ...)

 
 
Mark B
Guest
Posts: n/a
 
      05-06-2009
How can I set the Description below using a variable or a function rather
than hard-coding text (I have another function that returns the Description
text based on the user's language)?

' Visual Basic
Public Class Service1
Inherits System.Web.Services.WebService
<System.Web.Services.WebMethod( _
Description:="This method converts a temperature " & _
"in degrees Fahrenheit to a temperature in degrees Celsius.")> _
Public Function ConvertTemperature(ByVal dFahrenheit As Double) _
As Double
ConvertTemperature = ((dFahrenheit - 32) * 5) / 9
End Function
End Class




 
Reply With Quote
 
 
 
 
Mr. Arnold
Guest
Posts: n/a
 
      05-07-2009

"Mark B" <> wrote in message
news:...
> How can I set the Description below using a variable or a function rather
> than hard-coding text (I have another function that returns the
> Description text based on the user's language)?
>


Private ReadOnly varname As String = "Help"


> ' Visual Basic
> Public Class Service1
> Inherits System.Web.Services.WebService
> <System.Web.Services.WebMethod(Description:= &varname)> _
> Public Function ConvertTemperature(ByVal dFahrenheit As Double) _
> As Double
> ConvertTemperature = ((dFahrenheit - 32) * 5) / 9
> End Function
> End Class


I don't know if that's what you're talking about or not. I don't know if
"const" statement in VB either, but I kind of recall that you can use
"const" in VB too like C#.


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4058 (20090507) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



 
Reply With Quote
 
 
 
 
Mark B
Guest
Posts: n/a
 
      05-07-2009
That doesn't work.

The Description:= &varname is underlined with control-tip text saying:

"Constant expression is required."

"Mr. Arnold" <MR. > wrote in message
news:...
>
> "Mark B" <> wrote in message
> news:...
>> How can I set the Description below using a variable or a function rather
>> than hard-coding text (I have another function that returns the
>> Description text based on the user's language)?
>>

>
> Private ReadOnly varname As String = "Help"
>
>
>> ' Visual Basic
>> Public Class Service1
>> Inherits System.Web.Services.WebService
>> <System.Web.Services.WebMethod(Description:= &varname)> _
>> Public Function ConvertTemperature(ByVal dFahrenheit As Double) _
>> As Double
>> ConvertTemperature = ((dFahrenheit - 32) * 5) / 9
>> End Function
>> End Class

>
> I don't know if that's what you're talking about or not. I don't know if
> "const" statement in VB either, but I kind of recall that you can use
> "const" in VB too like C#.
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4058 (20090507) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57