Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Create module using Classic asp page codeCreate module using Classic asp page code
Previous
 
Next
New Post
9/26/2009 3:09 AM
 

I have classic asp page. That page create dynamic table using database table. THis code is very efficent code. Becouse it access database only one time. I want convert this page using same technology. Whats the best way to convert this page to dnn module

 

<html>
<body vlink="#0000FF" alink="#0000FF">
<table border=0 cellspacing="0" cellpadding="0" width=840>
  <tr>
    <td valign="top">
      <%
    'Set location to database
    sqlState = "DSN=theredzone;UID=theredzone;PWD=dm63146;"
    set Conn = Server.CreateObject("ADODB.Connection")
    Conn.open sqlstate
     'Open Recordset Object
     'mysql = "SELECT T.*, H1.PDate, H1.Headline, H1.Link, H1.idno FROM Team AS T, NFLHeadlines AS H1 WHERE T.ShortTeamName = H1.Team AND H1.PDate = (Select Max(PDate) FROM NFLHeadlines AS H2 Where H1.Team = H2.Team) ORDER BY T.Category, T.City, H1.idno;"
      mysql = "SELECT NFLTeam.*, H1.PDate, H1.Headline, H1.Link, H1.idno FROM NFLTeam INNER JOIN NFLHeadlines AS H1 ON NFLTeam.ShortTeamName=H1.Team WHERE H1.PDate = (Select Max(PDate) FROM NFLHeadlines Where H1.Team = NFLHeadlines.Team) ORDER BY NFLTeam.Category, NFLTeam.City, NFLTeam.TeamID, H1.idno;"
     Set rstemp = conn.Execute( mysql )

' ************************************************************
' support functions for building the "look" of the table
' ************************************************************

Sub ColumnHead( conference )
    If UCase(conference) = "AFC" Then fontc="#CC0000" Else fontc="#336699"
%>
      <!-- ***** BEGIN <%=conference%> COLUMN **** -->
    <td width="50%" valign="top"> <table width="100%" border="2" cellspacing="0" cellpadding="0">
        <tr>
          <td height="60" valign="top" align="center"> <img src="http://www.theredzone.org/images/<%=conference%>.gif" border="0" align="top"><br>
            <strong> <font color="<%=fontc%>" size="4" face="Verdana, Arial, Helvetica, sans-serif"><%=conference%></font>
            </strong> </td>
        </tr>
        <%
End Sub

Sub ColumnFoot
%>
      </table></td>
    <%
End Sub

Sub TeamHead( color, font, name )
%>
    <!-- ****** BEGIN TEAM <%=UCASE(name)%> ****** -->
  <tr>
    <td width="100%" height="19" bgcolor="<%=color%>" align=center> <font color="<%=font%>" face="Verdana, Arial, Helvetica, sans-serif" size="2">
      <strong>
      <div align="center"><a name="<%=name%>"></a><%=name%></div>
      </strong> </font> </td>
  </tr>
  <tr>
    <td> <table width="100%" border=0 cellpadding=0 cellspacing=0>
        <%
End Sub

Sub TeamFoot( team, id, forumid )
   forum = "http://forum.theredzone.org/viewforum.php?f="& forumid
%>
        <tr>
          <td colspan=2 height=20 valign="bottom" align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
            <a href= "http://ticketsolutions.com/nfl-<%=team%>-tickets.asp" rel="nofollow"><strong>Looking
            For <%=team%>' Tickets? Click Here</strong></a></font> </td>
        </tr>
        <tr>
          <td colspan=2 height=15 valign="bottom" align="center"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif">
            <a href= "http://www.theredzone.org/archives/showteam.asp?Team=<%=team%>">
            Miss a story? Look for it in our <%=team%>' News Archives</a> </font>
          </td>
        </tr>
        <tr>
          <td colspan=2 height=20 valign="top" align="center"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif">
            <a href="<%=forum%>"> Talk about it in the <%=team%>' Forum</a> </font>
          </td>
        </tr>
      </table></td>
  </tr>
  <%
End Sub
Sub Story( link, hl, pdt )
%>
  <tr>
    <td valign="Top" width="30" align="left"> <font face="verdana" size="2"><img src="http://theredzone.org/images/fbsmall.gif" width="15" height="15"></font>
    </td>
    <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
      <a href="<%=link%>"> <%=hl%></a> </font> <font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="blue"><%=pdt%></font>
    </td>
  </tr>
  <%
End Sub


' ************************************************************************
' Now begin output of the actual table:
' ************************************************************************

%>
  <table width=840 border=0 cellpadding=0 cellspacing=2>
    <tr>
      <!-- entire two team columns all in this one outer row -->
      <%
priorTeam = ""
priorConf = ""
priorTeamId = 0
priorForumId = 0

Do Until rsTemp.EOF
    curTeam = rsTemp("ShortTeamName")
    If curTeam <> priorTeam Then
        If priorTeam <> "" Then TeamFoot priorTeam, priorTeamId, priorForumId

        ' changed teams...did we also change conference?
        curConf = UCase( Left( rsTemp("Category"), 3 ) ) ' should be NFC or AFC??
        If curConf <> priorConf Then
             ' changed conference...start new column
             If priorConf <> "" Then ColumnFoot
             ColumnHead curConf
             priorConf = curConf
        End If
        ' and then show new team
        TeamHead rsTemp("TeamColor"), rsTemp("TeamFont"), curTeam
        ' we need to remember these three things ...
        ' ... in order to be able to create the TeamFoot
        priorTeam = curTeam
        priorTeamId = rsTemp("teamId")
        priorForumId = rsTemp("forumId")
    End If
    ' and finally we can output one "story" per "line"
    Story rstemp("Link"), rstemp("Headline"), rstemp("PDate")
    rstemp.MoveNext
Loop
TeamFoot priorTeam, priorTeamId, priorForumId
ColumnFoot
%>
    </tr>
  </table>
  <td align="left" valign="top">
   </center>
  </td>
  </tr>
</table>
</body>
</html>

Out put of this page is

http://theredzone.org/  (NFC and  AFC list)

 

 

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Create module using Classic asp page codeCreate module using Classic asp page code


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out