Hello All, anyone wanna put their thinking caps on, here goes.....
I am coming in to a situation where a scrolling messageboard on a plain html page, complete with a seperate administrator page to update the scrolling text, must be re-engineered. The messageboard application was written in asp.net (for the admin page) using a third party .dll (WebExportTechnologies.RTE
) that is not allowed, the funmctions were jscript, with VB functions used to get the messages stored in an access DB file. Here is a list of the files...
admin.aspx (for the admin page to update the content, using a RTE providfed by a 3rd party .dll)
functions.vb (gets the content from the access db)
messages.aspx (parses the information and is called on the .html page where a div calls the content)
messageboard.mdb(holds messages updated by admin) and index.html(where the messages scroll)
While this application and content manager are great, they need to come down, but retain the messages. Basically I am looking to leverage the existing code so as I can just hand code the messages from the backend, and I believe this will be simple, but I am having a tough time figuring on how to proceed - I am a mid level programmer at best, and was just the assistant...now I am the only one!!!
Here is the code on the messages.aspx page that calls the content from function.vb....
dim dsMessages as dataset
sub page_load()
if not page.IsPostBack() then
dsMessages = GetEnabledMessages()
end if
end sub
and underneath it is where the function is written that controls the messages appearance....
var currentMessageIndex = 0
var ns4 = (document.layers)? true:false;
var msie = (document.all)? true:false;
var messages = new Array(<%= dsMessages.tables(0).rows(
).count %>);
<%
dim intMessageCount as integer = 0
dim drMessage as datarow
for each drMessage in dsMessages.tables(0).rows
response.write ("messages[" & intMessageCount & "] = """ & server.htmlDecode(server.h
tmlEncode(
drMessage(
"Message")
)) & """;" & vbcrlf)
intMessageCount += 1
next
%>
function startMessageBoard(){
document.getElementById("i
nnerDiv").
innerHTML = messages[currentMessageInd
ex];
window.setTimeout("moveMes
sagesUp()"
, 0);
}
....ETC...
I believe I can simply use this page to write a new function that enables me to get rid of the need for the functions.vb, the DB, and the admin page. I feel like dsMessages = GetEnabledMessages() ,
where GetEnabledMessages() can be a new function is the way to go...GetEnabledMessages() on the functions page is written as this, just so you know...
function GetEnabledMessages() as dataset
Dim strConnection as String = "Provider=Microsoft.Jet.OL
EDB.4.0; Data Source=" & Server.MapPath("messageBoa
rd.mdb")
dim strSQL as string = "SELECT * FROM Messages WHERE isEnabled=true ORDER BY Precedence"
dim objDataSet as new DataSet()
dim objConnection as new oledbconnection(strConnect
ion)
dim objAdapter as new oledbdataadapter(strSQL, objConnection)
objAdapter.fill(objDataSet
)
return objDataSet
end function
This is my first job out of college. Have mercy on me, it is fairly easy I believe, but I posted it as expert as so whoever can help grasps the concepts I am speaking about. I actually helped write this app, but had guidance that is no longer working here....Thanks, and let me know if you need any more information!!!
Start Free Trial