Re: Code Behind Page
- From: "Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com>
- Date: Wed, 25 May 2005 21:51:58 +0000
Hi,
Could you please post the class code generated by Visual Studio or just send it to me by email?
I am using Web Matrix. I consider it simpler to use.
Thanks, Miguel
"Egghead" <robertlo_NO_SPAM@xxxxxxx> wrote in message news:robertlo_NO_SPAM@xxxxxxx:
I think I will do it in my way :)
1. go to file menu, add a new project ( vb.net or C#), choose ClassLibrary 2. at the solution explorer, left click at the ClassLibrary project, properties, configuration properties, change the output path to your website's bin folder 3. go to the ClassLibrary project, you should c the class, view code, add the function,sub, and a constructor inside the class, build the ClassLibrary. 4. go to your web site project, add the reference, browse to your website's bin folder. You should c the dll file now. add that. 5. in your page's VB.net/C# code, you should be able to do the following, or use the object tag in the asp page (I never try it) dim myclass as ClassLibrary myclass.whatever(whatever) or ClassLibrary myclass = new ClassLibrary(); myclass.whatever(whatever)
If you want to step into the classlibrary for debugging, go to enable unmanaged debugging and generate debugging information.
Egghead "Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message news:%23h4EOVLYFHA.3408@xxxxxxxxxxxxxxxxxxxxxxx
> Hello, > > Can you give me a simple example of a file which has a class that > includes 2 functions to be used by all pages in my web site: > > Function Fill_Content(Dim page As String) > End Function > > Sub Build_Menu > End Sub > > And how would I call this class in a page code? > > Thanks, > Miguel > > "Egghead" <robertlo_NO_SPAM@xxxxxxx> wrote in message > news:robertlo_NO_SPAM@xxxxxxx: >
> > Why not make a vb.net or C# class holds all your common functions and
put it
> > in your web site's bin folder? > > Egghead > > "Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message > > news:OikwySKYFHA.2888@xxxxxxxxxxxxxxxxxxxxxxx > >
> > > Hello, > > > > > > When creating an ASP.NET/VB web site I place my code in a code behind > > > page, i.e., aspx.vb. > > > > > > Sometimes I have functions which are common to all aspx files. > > > > > > Is it possible in page1.aspx to use page1.aspx.vb and also a common
file
> > > named global.aspx.vb which will hold all the functions common to all > > > aspx files in a web site. > > > > > > How can this be done? > > > Should I do it? > > > > > > Thanks, > > > Miguel > > >
>
.
- Follow-Ups:
- Re: Code Behind Page
- From: Egghead
- Re: Code Behind Page
- References:
- Re: Code Behind Page
- From: Egghead
- Re: Code Behind Page
- Prev by Date: Re: How can I connect to a remote database?
- Next by Date: Related Dynamic Controls / Viewstate Problem
- Previous by thread: Re: Code Behind Page
- Next by thread: Re: Code Behind Page
- Index(es):
Relevant Pages
|