G
Guest
I am using the page_load event to load a user control within a place holder
control and display it on a page. Then I use response.write statements to
loop through the rows of a data table and display the contents on the page.
However, the contents of the table always appear above the user control
instead of being below the control. How can I place the contents of the tabe
below the place holder. See sample code below:
sub page_load(source as object, e as eventargs) Handles MyBase.Load
plcheadbanner.Controls.Add(LoadControl("MainBanner.a Dim
ds As New DataSet()
Dim myconn As String =
ConfigurationSettings.AppSettings.Item("ConnectionString")
Dim cnn As OleDbConnection
Dim stremail
stremail = Session("Emailid")
cnn = New OleDbConnection(myconn)
Dim dp As New OleDbDataAdapter("Select * from [project
permissions] where email = '" & stremail & "'", cnn)
cnn.Open()
Dim userinfotb As DataTable
Dim loop1, numrows As Integer
dp.Fill(ds)
userinfotb = New DataTable()
userinfotb = ds.Tables(0)
numrows = userinfotb.Rows.Count
If numrows = 0 Then
Response.Write("<p>There are NO Projects assigned to
you at this moment</p>")
Else
For loop1 = 0 To numrows - 1
Response.Write((userinfotb.Rows(loop1).Item("project
ID")) & "<br>")
Next loop1
End If
cnn.Close()
End Sub
control and display it on a page. Then I use response.write statements to
loop through the rows of a data table and display the contents on the page.
However, the contents of the table always appear above the user control
instead of being below the control. How can I place the contents of the tabe
below the place holder. See sample code below:
sub page_load(source as object, e as eventargs) Handles MyBase.Load
plcheadbanner.Controls.Add(LoadControl("MainBanner.a Dim
ds As New DataSet()
Dim myconn As String =
ConfigurationSettings.AppSettings.Item("ConnectionString")
Dim cnn As OleDbConnection
Dim stremail
stremail = Session("Emailid")
cnn = New OleDbConnection(myconn)
Dim dp As New OleDbDataAdapter("Select * from [project
permissions] where email = '" & stremail & "'", cnn)
cnn.Open()
Dim userinfotb As DataTable
Dim loop1, numrows As Integer
dp.Fill(ds)
userinfotb = New DataTable()
userinfotb = ds.Tables(0)
numrows = userinfotb.Rows.Count
If numrows = 0 Then
Response.Write("<p>There are NO Projects assigned to
you at this moment</p>")
Else
For loop1 = 0 To numrows - 1
Response.Write((userinfotb.Rows(loop1).Item("project
ID")) & "<br>")
Next loop1
End If
cnn.Close()
End Sub