Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > sorry: and now with subject: how to reuse function in any page of application?

Reply
Thread Tools

sorry: and now with subject: how to reuse function in any page of application?

 
 
michel
Guest
Posts: n/a
 
      02-18-2007
Hi,

i defined a function (no matter what it does) in code-behind of an aspx page
like this:

Public Function myfunction(ByVal x As Object) As String
Dim tmp As String = x.ToString()
.......
Return tmp
End Function

Now i would like to use that function in any aspx pages of my asp.net
application.
How can i do that?

Thanks
Michel



 
Reply With Quote
 
 
 
 
Patrick
Guest
Posts: n/a
 
      02-18-2007
You can create a new class which will be added to the App_Code directory

Check out
http://dotnetjunkies.com/QuickStartv...ages/code.aspx

"michel" <mm@mmm> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> i defined a function (no matter what it does) in code-behind of an aspx
> page
> like this:
>
> Public Function myfunction(ByVal x As Object) As String
> Dim tmp As String = x.ToString()
> .......
> Return tmp
> End Function
>
> Now i would like to use that function in any aspx pages of my asp.net
> application.
> How can i do that?
>
> Thanks
> Michel
>
>
>



 
Reply With Quote
 
 
 
 
michel
Guest
Posts: n/a
 
      02-18-2007
Thanks

"Patrick" <(E-Mail Removed)> schreef in bericht
news:u$(E-Mail Removed)...
> You can create a new class which will be added to the App_Code directory
>
> Check out
> http://dotnetjunkies.com/QuickStartv...ages/code.aspx
>
> "michel" <mm@mmm> wrote in message
> news:(E-Mail Removed)...
>> Hi,
>>
>> i defined a function (no matter what it does) in code-behind of an aspx
>> page
>> like this:
>>
>> Public Function myfunction(ByVal x As Object) As String
>> Dim tmp As String = x.ToString()
>> .......
>> Return tmp
>> End Function
>>
>> Now i would like to use that function in any aspx pages of my asp.net
>> application.
>> How can i do that?
>>
>> Thanks
>> Michel
>>
>>
>>

>
>



 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
To reuse or not to reuse jacob navia C Programming 19 12-18-2006 07:22 AM
code reuse and design reuse sailor.gu@gmail.com C Programming 16 02-12-2006 09:09 PM
Reuse paramter list and reuse connection tshad ASP .Net 5 05-17-2005 12:33 AM
To reuse or not to reuse.... Hylander Java 0 02-26-2004 12:00 AM



Advertisments