vb net sub function where do i put them

  • Thread starter Thread starter jcharth
  • Start date Start date
J

jcharth

Hello I am trying to write a aspx webpage that grabs data from a access
database. It seems to work but I am trying to avoid repeating all code.
Can i declare i sub or function somewhere in the aspx file to avoide
repeating things? I just cant seem to find any samples that have a
funtion in the code. Can anyone post a tiny sample that prints html
tags and functions in a single file? thanks.
 
Got it, a little complicate to find an example but i think i was all
about placing
<%@ Page Language="VB" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<script language="VB" runat="server">
 
Jchart,

In OOP this is what you do by using classes. (The DataAccessLayer class
often named in this case).

You can make a class containing all your data handling and instance that in
every page.

You can as well use a shared class (a kind of module). Be aware that you can
normally not hold data (beside constants) in a shared class for ASPX (or
that goes in a very difficult way).

The easiest way using this is in code behind by the way.

I hope this helps,

Cor
 
Back
Top