473,889 Members | 1,823 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
Jul 21 '05 #1
0 2472

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

Similar topics

4
7868
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:
0
1088
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
2758
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
6089
by: SteveB | last post by:
How can I write a break on Web Form using C#?
0
1175
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
2542
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
3175
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
0
1693
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
7
3636
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
9966
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
11199
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
10791
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...
1
10894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10442
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5830
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...
1
4647
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
2
4251
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3256
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.