Quote:
Originally Posted by vinyl-junkie
Are you able to use master pages? If so, is the code you're talking about something that could be put in the master page?
|
And here it is an example of some code I need to replicate and maintain inside each page.
Is it posible to do it with master pages without using code behind the lines?
<%@Page Language="VB" explicit="true" %>
<%@Import Namespace="System.Data" %>
<%@Import Namespace="System.Data.OleDb" %>
<%@Import Namespace="System.Net.Mail" %>
<%@Import Namespace="System.IO" %>
<%@Import Namespace="System" %>
<!DOCTYPE html Public "-//W3C//DTD Xhtml 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
'---- Connection string ----
Protected strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db\HR_LES_080508.mdb") & ";User Id=admin;Password=;"
Protected micsSTRConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db\MICS.mdb") & ";User Id=admin;Password=;"
'---- Connection object ----
Protected hrlesConnection As OledbConnection 'Connection Object to db
Protected micsConnection As OleDbConnection 'Connection object to MICS DB
'---- Connection adapter ----
Protected dbAdapter As OleDbDataAdapter 'Command db Adapter
Protected micsAdapter As OleDbDataAdapter 'Command mics Adapter
'---- Connection dataset ----
Protected dbDataSet As DataSet 'db DataSet (instead Recordset)
Protected micsDataSet As DataSet 'mics dataset
'---- User ----
Protected username, serverDomain As String 'SignetID and domain
Protected signetID As String
Protected userID As Integer
Function checkForFIAssistantStatus() As Boolean
Dim dbTable As DataTable 'Data reception table
Dim sqlSTR As String
Dim numRows As Integer
dbTable = New DataTable
' String por adapter command
sqlSTR = " SELECT tbStatus.lesID, tbStatus.codeID, tbStatus.startDate, " _
& "tbStatus.endDate, tbStatus.numericValue, tbStatus.stringValue " _
& "FROM tbLes INNER JOIN tbStatus ON tbLes.ID = tbStatus.lesID " _
& "WHERE (((tbStatus.codeID)=243) AND ((tbLes.signetID)=""" & pageUserSignetID & """)) " _
& "ORDER BY tbStatus.endDate DESC;"
sqlCommandAndFill(sqlSTR) 'Assign Adapter command and Data set
dbTable = dbDataSet.Tables(0) 'Assign table
numRows = dbTable.Rows.Count
If numRows > 0 Then
If dbTable.Rows(0).Item("endDate") > Now Then
Return True
End If
End If
Return False
End Function
'Business rules assignment procedure to hidden fields
Sub createBusinessRulesFields()
'1 010 Office Working Hours per Week
Response.Write("<input name=""brOfficeWorkHoursWeekField"" id=""brOfficeWorkHoursWeekField"" " _
& "type=""hidden"" value=""" & brOfficeWorkHoursWeek & """ />")
'2 020 Non Office Working Hours per Week
Response.Write("<input name=""brNonOfficeWorkHourWeekField"" id=""brNonOfficeWorkHourWeekField"" " _
& "type=""hidden"" value=""" & brNonOfficeWorkHourWeek & """ />")
'3 030 Office Working Hours per Day
Response.Write("<input name=""brOfficeWorkHoursDayField"" id=""brOfficeWorkHoursDayField"" " _
& "type=""hidden"" value=""" & brOfficeWorkHoursDay & """ />")
End Sub
....... And many functions more