Re: Can you call asp function in asp.net?

From: Cor Ligthert (notmyfirstname_at_planet.nl)
Date: 12/02/04


Date: Thu, 2 Dec 2004 17:27:32 +0100

Kat,

I tried to show you the in my opinion nicest version.

<script language="VB" runat=server>
'this is nicer in ASPX and than all your subs and functions inside that.
It is not needed you can keep your old ASP style. Adviced is as far as I
know to upgrade this when busy with it. Doing that than it is easier to go
to code behind in future. Than you can by the way in the VBNet 2002/2003
versions not use your Inc pages anymore. (I don't know how that is in 2005)

function test(ByVal strValue as String) as String

'This is in my opinion your error. You did not write the return type "as
String".
'ByValue is in VBNet/CSharp almost forever more efficient than ByRef
'A reason to use ByRef can when you create a new object inside the function

Return replace(strValue,"'","''")
'This I find myself much nicer, however when you want what you had than that
is no problem at all.

I hope this helps?

Cor



Relevant Pages

  • Re: use of "return"
    ... at the end of a method, 'return' is indeed not needed, and simply that value will suffice, though i think a return looks nicer;-) ... def method ... in the light of Duck Typing usually no ...
    (comp.lang.ruby)
  • Re: Dumping an array to a web page
    ... Peter Fox wrote: ... string '1', hence the var_dump.If you don't need it the layout of print_r ... is indeed somewhat 'nicer'. ...
    (comp.lang.php)
  • Stringizing escape character tokens, std. or not?
    ... const char *mystr2 = FOO; ... ....but if anyone knows of a nicer way of doing the above, ... C String APIs use too much memory? ...
    (comp.std.c)
  • Replacing a switch
    ... which was much nicer (to my mind) ... switch ...
    (alt.comp.lang.learn.c-cpp)