473,757 Members | 9,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing HTML <br> code into a panel or placeholder

Hello everyone,

I am in a bit of a dilema trying to write an HTML <br> tag into a panel or
placeholder.

Here is the situation

I have 4 tables that represent 4 levels of data (level4 is linked to a
level3 etc) all the way up to a level 1

Example

Level1
Level2a
Level2b
Level3a
Level3B
Level4a
Level4b
Level2c
I am using a datalist to contain these 4 levels, but I want to recreate a
tree like structure so that the user can easily see what level2's are in a
level1 as well as select a particular level to see its details.

The link buttons work fine but I am unable to get the levels to look right.
So I looked at trying to add a BR tag at the end of each level but it does
not seem to be working.

This is the result that I am getting:

Level1Level2aLe vel........

When I look at the View Source on the web page the <br> tags are NOT there.

What am I doing wrong?

I thought about trying to use HtmlTextWriter, but I have NO idea how that
works and the examples in VS are not very explicit.

Any help would be much appreciated... I am even open to other ways to create
this tree like structure.

BTW - I am using VS 2003.

Here is the code that I have created so far for my datalist itemdatabound:

Private Sub dlstMaster_Item DataBound(ByVal sender As Object, ByVal e As
System.Web.UI.W ebControls.Data ListItemEventAr gs) Handles
dlstMaster.Item DataBound
Dim dv As DataRowView = e.Item.DataItem
Dim spacer As New LiteralControl( "<br>")
Dim level1linkbutto n As New LinkButton
Dim level1panel As PlaceHolder = e.Item.FindCont rol("Level1Pane l")
level1linkbutto n.Text = dv("Level1Name" )
level1linkbutto n.CommandArgume nt = dv("Level1Id"). ToString
level1linkbutto n.CommandName = "Level1Clic k"
level1panel.Con trols.Add(level 1linkbutton)
level1panel.Con trols.Add(space r)
Dim ds As New DataSet
ds = Session("ds")
If Not dv Is Nothing Then
Dim level2dv As DataView
level2dv = dv.CreateChildV iew("level2")
Dim row As DataRowView
For Each row In level2dv
Dim level2linkbutto n As New LinkButton
level2linkbutto n.Text = row("Level2Name ")
level2linkbutto n.CommandArgume nt = row("Level2Id") .ToString
level2linkbutto n.CommandName = "Level2Clic k"

level1panel.Con trols.Add(level 2linkbutton)
level1panel.Con trols.Add(space r)
' Now loop through the level 3 details
Dim level3dv As DataView
level3dv = New DataView(ds.Tab les("AllLevel3" ), "Level2Id =
'" & row("Level2Id") .ToString & "'", "Level3Name ",
DataViewRowStat e.CurrentRows)
Dim level3row As DataRowView
For Each level3row In level3dv
Dim level3linkbutto n As New LinkButton
level3linkbutto n.Text = level3row("Leve l3Name")
level3linkbutto n.CommandArgume nt =
level3row("Leve l3Id").ToString
level3linkbutto n.CommandName = "Level3Clic k"
level1panel.Con trols.Add(level 3linkbutton)
level1panel.Con trols.Add(space r)
' now get the level 4's
Dim level4dv As DataView
level4dv = New DataView(ds.Tab les("AllLevel4" ),
"Level3Id = '" & level3row("Leve l3Id").ToString & "'", "Level4Name ",
DataViewRowStat e.CurrentRows)
Dim level4row As DataRowView
For Each level4row In level4dv
Dim level4linkbutto n As New LinkButton
level4linkbutto n.Text = level4row("Leve l4Name")
level4linkbutto n.CommandArgume nt =
level4row("Leve l4Id").ToString
level4linkbutto n.CommandName = "Level4Clic k"
level1panel.Con trols.Add(level 4linkbutton)
level1panel.Con trols.Add(space r)
Next
Next
Next
End If
End Sub

The problem is that when I add the spacer control (a literal control with
the BR in it) it is not added into the placeholder. I have tried to use a
panel, with the same effect
Nov 22 '05 #1
0 1690

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7862
by: fis | last post by:
Hi all, I've problem because there are needed break lines in my texts on the web site but i can't do it :( My pipeline looks like: XMS -> I18N -> XSLT -> HTML I have lot of texts in my "languages" files and these are describes for things on my website. Example text looks like this:
2
1948
by: John D | last post by:
can anyone explain why a site would use this in their page <!--<BR>--> Presumably it is hiding the <BR> from ... ??? TIA John
0
2469
by: CoreyMas | last post by:
Hello everyone, I am in a bit of a dilema trying to write an HTML <br> tag into a panel or placeholder. Here is the situation I have 4 tables that represent 4 levels of data (level4 is linked to a level3 etc) all the way up to a level 1
0
1082
by: George Ter-Saakov | last post by:
I have a composite control. Which has 2 parts. Under some conditions first part must be shown sometimes another. So naturally I used 2 Panel object. And hide one of them. The problem is that hidden Panel object renders itself as <br>. Not sure what is the purpose of it. But it ads extra line which is not acceptable. Is there another control which when hidden is HIDDEN and does not render anything.
7
2749
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no tags will remain making the page safe (I have to convert the linefeeds to <BR>s because the Server.EncodeHTML does not do that it seems). The problem is that users can use a special tag when editing the top to specify an area of the tip that will...
5
6078
by: SteveB | last post by:
How can I write a break on Web Form using C#?
0
1168
by: info | last post by:
I have a datalist with ItemTemplate as a part of my control, however every time the ItemTemplate repeats, it inserts a <br>. How do I get it to not insert a <br>? I need it to be a DataList as opposed to a repeater so that I have access to the OnUpdateCommand. <asp:Panel id="DetailsPanel" runat="server"> <TABLE cellSpacing="0" cellPadding="0" width="100%" border="0"> <TR><TD><DIV align="center"><FONT color="black"...
2
2533
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all the charcontrols option and chr(13) with success.. was using the following code: Dim s As String = MyTextbox.Text
1
3171
by: Winshent | last post by:
I have a multi line text in an admin page on my cms. I am trying to capture carriage returns as and replace them with <p></p> bfore the string gets written to the database. I have tried all the charcontrols option and chr(13) with success.. was using the following code: Dim s As String = MyTextbox.Text
7
3626
by: Nathan Sokalski | last post by:
Something that I recently noticed in IE6 (I don't know whether it is true for other browsers or versions of IE) is that it renders <br/and <br></br> differently. With the <br/version, which is what most people use when they write static code (some people use <br>, but with xhtml you are required to close all tags), IE6 simply breaks to the next line like it is supposed to. However, with <br></br>, which is what is sometimes generated by...
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9906
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.