Click here to Skip to main content
15,900,511 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Page.Response.Redirect not working Pin
jkirkerx9-Aug-12 6:50
professionaljkirkerx9-Aug-12 6:50 
AnswerRe: Page.Response.Redirect not working Pin
AspDotNetDev9-Aug-12 6:51
protectorAspDotNetDev9-Aug-12 6:51 
AnswerMessage Closed Pin
9-Aug-12 8:14
professionaljkirkerx9-Aug-12 8:14 
GeneralRe: Page.Response.Redirect not working Pin
dcof9-Aug-12 12:11
dcof9-Aug-12 12:11 
GeneralRe: Page.Response.Redirect not working Pin
jkirkerx9-Aug-12 17:09
professionaljkirkerx9-Aug-12 17:09 
GeneralRe: Page.Response.Redirect not working Pin
dcof9-Aug-12 18:40
dcof9-Aug-12 18:40 
AnswerRe: Page.Response.Redirect not working Pin
dipurajp10-Aug-12 2:42
dipurajp10-Aug-12 2:42 
GeneralRecursion from asp classic to asp net Pin
EnricoRS19-Aug-12 4:45
EnricoRS19-Aug-12 4:45 
HTML
<html>
<body>
   <table id="thread-board">
    <tr>
        <td width="68%">Subject</td>
        <td width="12%">Username</td>
        <td width="20%">Date Posted</td>
    </tr>
    <%=ShowMessages(0)%>
</table>
</body>
</html>

'/////////////////////////////////////////
'///// THREAD - MESSAGES //////////////////
intLevel = 0
Function ShowMessages(intParent) 
  intLevel = intLevel + 1
  strSQL = "SELECT * FROM fmsg WHERE fmsg.msg_parent = " & intParent & " ORDER BY CDATE(msg_date) DESC "
  Set rstForumMessages = conn.Execute(strSQL) 
  Do Until rstForumMessages.EOF 
      response.write("<tr>")
      response.write("<td width='68%'><img src='dot.gif' width='" & ((intLevel * 24)-24) & "'>" & rstForumMessages("msg_object") & "</td>")
      response.write("<td>" & rstForumMessages("msg_uid") & "<td>")
      response.write("<td>" & rstForumMessages("msg_date") & "<td>")
      response.write("</tr>")
      ShowMessages(rstForumMessages("msg_id"))
        rstForumMessages.MoveNext 
    intLevel = intLevel - 1
  Loop
End Function 
'/////  THREAD - MESSAGES //////////////////
'////////////////////////////////////////


The function above is an asp classic function that I used to display messages and replies in a forum (a sort of treeview). I tried to translate it in asp net but it doesn't work properly.

HTML
Imports System
Imports System.IO
Imports system.web.ui
Imports system.web.ui.webcontrols
Imports system.web.ui.htmlcontrols
Imports system.configuration
Imports system.data
Imports system.data.oledb
Public Class Messages
    Inherits page

'////////////////////////////////
Dim CN As OleDb.OleDbConnection
Dim CMD As OleDb.OleDbCommand
Dim SQL As String
Dim ODR As OleDb.OleDbDataReader
Dim ODR2 As OleDb.OleDbDataReader
'/////////////////////////////////////
 Function ShowMessages(intParent As Integer) As String
        Dim tt2 As String = String.Empty
        SQL = " SELECT * FROM fmsg WHERE msg_parent=" & intParent
        CMD = New OleDbCommand(SQL, CN)
        CN.Open()
        ODR2 = CMD.ExecuteReader()
        If ODR2.HasRows Then
            tt2 = ""
            While ODR2.Read
                intLevel = intLevel + 1
                tt2 += "<table>"
                tt2 += "<tr>"
                tt2 += "<td rowspan=""2""><img src='dot.gif' style='width:" & ((intLevel * 14) - 14) & "px'  /></td>"
                tt2 += "<td class='child-title'>" & ODR2("msg_id") & " - " & ODR2("msg_object") & "</td>"
                tt2 += "</tr>"
                tt2 += "<tr>"
                tt2 += "<td class='child-body'>" & ODR2("msg_body") & "</td>"
                tt2 += "</tr>"
                tt2 += "</table>"
                tt2 += getChildNode(ODR2("msg_id"))
                intLevel = intLevel - 1
            End While
            tt2 += ""
        End If
        CN.Close()
        Return tt2
    End Function
End Class


modified 9-Aug-12 14:58pm.

AnswerRe: Recursion from asp classic to asp net Pin
Wes Aday9-Aug-12 5:54
professionalWes Aday9-Aug-12 5:54 
GeneralRe: Recursion from asp classic to asp net Pin
EnricoRS19-Aug-12 9:00
EnricoRS19-Aug-12 9:00 
AnswerRe: Recursion from asp classic to asp net Pin
jkirkerx9-Aug-12 8:19
professionaljkirkerx9-Aug-12 8:19 
GeneralRe: Recursion from asp classic to asp net Pin
EnricoRS19-Aug-12 9:01
EnricoRS19-Aug-12 9:01 
GeneralThis is how I would of wrote it, Pin
jkirkerx10-Aug-12 7:04
professionaljkirkerx10-Aug-12 7:04 
QuestionGridview formatting acts wierd when dployed in server Pin
preetham_s8-Aug-12 20:40
preetham_s8-Aug-12 20:40 
QuestionRe: Gridview formatting acts wierd when dployed in server Pin
Eddy Vluggen9-Aug-12 0:56
professionalEddy Vluggen9-Aug-12 0:56 
QuestionIssue for Quartz schedular Pin
Shirish kumar manda8-Aug-12 20:39
Shirish kumar manda8-Aug-12 20:39 
AnswerRe: Issue for Quartz schedular Pin
Eddy Vluggen9-Aug-12 0:54
professionalEddy Vluggen9-Aug-12 0:54 
Questioncms Pin
Member 93252298-Aug-12 20:10
Member 93252298-Aug-12 20:10 
SuggestionRe: cms Pin
Eddy Vluggen9-Aug-12 0:55
professionalEddy Vluggen9-Aug-12 0:55 
AnswerRe: cms Pin
Paul Conrad9-Aug-12 19:11
professionalPaul Conrad9-Aug-12 19:11 
Questionsetup hyperlink Pin
sc steinhayse8-Aug-12 8:01
sc steinhayse8-Aug-12 8:01 
AnswerRe: setup hyperlink Pin
R. Giskard Reventlov8-Aug-12 8:55
R. Giskard Reventlov8-Aug-12 8:55 
GeneralRe: setup hyperlink Pin
sc steinhayse8-Aug-12 9:31
sc steinhayse8-Aug-12 9:31 
GeneralRe: setup hyperlink Pin
R. Giskard Reventlov8-Aug-12 9:57
R. Giskard Reventlov8-Aug-12 9:57 
GeneralRe: setup hyperlink Pin
jkirkerx8-Aug-12 10:35
professionaljkirkerx8-Aug-12 10:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.