Re: Code Behind Page



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
> > >
>


.



Relevant Pages

  • Re: Code Behind Page
    ... go to the ClassLibrary project, you should c the class, view code, add ... go to your web site project, add the reference, browse to your website's ... If you want to step into the classlibrary for debugging, ... >>> Sometimes I have functions which are common to all aspx files. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Code Behind Page
    ... in your web site's bin folder? ... > Sometimes I have functions which are common to all aspx files. ... > aspx files in a web site. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to debug using a private address?
    ... DEBUG is listed for all asp/asp.net extentions. ... So I re-assigned the default web site to the application folder. ... Then it said debugging wasn't enabled ... So on the server, I opened the original web I was working on by ...
    (microsoft.public.dotnet.framework.aspnet)
  • Why Remote Debugging prompt when using IIS6 & VS2005 on 2003 server
    ... I RDP into a 2003 server and run VS2005 locally. ... I open a web site in VS2005 unsing the IIS option in File Open New Web ... Unable to start debugging on the web server. ... OK, now before anyone tells me how to setup remote debugging, that is ...
    (microsoft.public.vsnet.debugging)
  • Re: BTS2004 + infopath + BAS
    ... Internet Explorer and try again. ... try debugging the InfoPath solution by adding ... "debugger" statement in the script. ... Check InfoPath web site for getting information about debugging ...
    (microsoft.public.biztalk.general)