Re: Code Behind Page
- From: "Egghead" <robertlo_NO_SPAM@xxxxxxx>
- Date: Tue, 24 May 2005 22:42:26 -0600
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: Shapper
- Re: Code Behind Page
- References:
- Re: Code Behind Page
- From: Egghead
- Re: Code Behind Page
- From: Shapper
- Re: Code Behind Page
- Prev by Date: How to know when session is end?
- Next by Date: Re: How to track download file from website?
- Previous by thread: Re: Code Behind Page
- Next by thread: Re: Code Behind Page
- Index(es):
Relevant Pages
|