Optional parameters on ASP.net using VB function

HI

Would be possible to use "optional" parameters on asp.net/vb functions instead of overloading it ?

Thanks in advance.
dimensionavAsked:
Who is Participating?
 
Pratima PharandeCommented:
it is possible to have option parameters
try this

     adduser("firstname")
        adduser("firstname", "Lastname")
Function
Public Function adduser(ByVal firstname As String, Optional ByVal Lastname As String = "") As String
        Return "test"
    End Function
 
Function calls

Open in new window

0
 
Kumaraswamy RCommented:
Hi.
 In VB.net Optional parameter not possible, So we can use Function Over loading. It sloves Ur Problem
0
 
dimensionavAuthor Commented:
pratima_mcs:

You´re right, I have found this: http://www.knowdotnet.com/articles/optionalparams.html, and they recommend not to use it, but the fact is that optional parameters are available on asp/vb .net.

Thanks
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Pratima PharandeCommented:
yes we can't say that "VB.net Optional parameter not possible"
0
 
dimensionavAuthor Commented:
I have asked for assistance in order to reassign the points to your answer.

Thanks.
0
 
dimensionavAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.