Have a look at this VB.NET code:
<PageMethod(True)> _
<UrlFormat("~/{year}/Formulare.aspx")> _
Protected Sub ShowForms(<ParamFormat(Formats.Year4)> ByVal year As
Integer)
'...
End Sub
Formats is a Module/static class and Year4 a string constant: "0000".
The rendered URL looks like this:
http://localhost:2000/WebSite/Formats2006Year4/Formulare.aspx
instead of
http://localhost:2000/WebSite/2006/Formulare.aspx
Do you have any ideas or solutions for this?
Thanks.
Marco
I've been able to reproduce the problem and I understand where the
problem comes from. Unfortunately, there is no easy way the PageMethods
add-in can get the value of constants. PageMethods uses Visual Studio's
code model, which only provides "Formats.Year4" as the argument for the
ParamFormat attribute. I haven't found a way to evaluate
"Formats.Year4" to get "0000".
Maybe this is something you'll be able to do once we use a different
parser, but for the moment, you can't use constants as arguments to
PageMethods' attributes.
Fabrice
thanks for your answer and explanations.
Marco