473,729 Members | 2,355 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 2467

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:
0
1079
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
2744
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
6076
by: SteveB | last post by:
How can I write a break on Web Form using C#?
0
1167
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
2532
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
0
1688
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
3624
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
9281
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
9200
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
9142
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
8148
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...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
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
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
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
2163
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.