473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Start and End HTML tags as 2 different Literal controls.

Hi,

I have been working on creating a dynamic table with controls on a
ASP.NET webpage and i have been using literal controls to do that. The
issue that i am facing is, when i have the Start and End tag as 2
different literal controls, they do not seem to form a part of my
table in the second scenario below.

plhTMReview - Placeholder
StartLiteral - String Variable
EndLiteral - String Variable
Literal() - Custom Function to create Literal control.

Function Literal(ByVal HTMLCode As String)
Dim litCode As New Literal
litCode.Text = HTMLCode
Literal = litCode
End Function

'This code works fine.
================
1. StartLiteral = "<tr<td align=""center"" bgcolor=""#ffffff""
colspan=""2""<font face=""Verdana, Arial, Helvetica"">Test Info"
EndLiteral = "</font</td</tr>"
plhTMReview.Controls.Add(Literal(StartLiteral))
plhTMReview.Controls.Add(Literal(EndLiteral))
=================

Both 1 and 2 above create a table row and table data for me
'But this code doesnt.
====================
1. StartLiteral = "<tr<td align=""center"" bgcolor=""#ffffff""
colspan=""2"">"
plhTMRequest.Controls.Add(Literal(StartLiteral))

2. StartLiteral = "<font face=""Verdana, Arial, Helvetica"">Test
Info"
EndLiteral = "</font<br>"
plhTMReview.Controls.Add(Literal(StartLiteral))
plhTMReview.Controls.Add(Literal(EndLiteral))

3. EndLiteral = "</td</tr>"
plhTMRequest.Controls.Add(Literal(EndLiteral))
=====================

In the above case, 1 and 3 do not form a part of the markup but 2
does. Also, 2 is not created as a literal control of a table row/data
but it form a part of placeholder directly. When i right click on the
browser and view source code, it does not contain markup for 1 and 3.

Did i do something wrong? or am i overlooking something?

Thanks,
Hetal.
Sep 10 '08 #1
1 1636
"Hetal" <he*************@gmail.comwrote in message
news:df**********************************@v39g2000 pro.googlegroups.com...
Hi,

I have been working on creating a dynamic table with controls on a
ASP.NET webpage and i have been using literal controls to do that. The
issue that i am facing is, when i have the Start and End tag as 2
different literal controls, they do not seem to form a part of my
table in the second scenario below.

plhTMReview - Placeholder
StartLiteral - String Variable
EndLiteral - String Variable
Literal() - Custom Function to create Literal control.

Function Literal(ByVal HTMLCode As String)
Dim litCode As New Literal
litCode.Text = HTMLCode
Literal = litCode
End Function

'This code works fine.
================
1. StartLiteral = "<tr<td align=""center"" bgcolor=""#ffffff""
colspan=""2""<font face=""Verdana, Arial, Helvetica"">Test Info"
EndLiteral = "</font</td</tr>"
plhTMReview.Controls.Add(Literal(StartLiteral))
plhTMReview.Controls.Add(Literal(EndLiteral))
=================

Both 1 and 2 above create a table row and table data for me
'But this code doesnt.
====================
1. StartLiteral = "<tr<td align=""center"" bgcolor=""#ffffff""
colspan=""2"">"
plhTMRequest.Controls.Add(Literal(StartLiteral))

2. StartLiteral = "<font face=""Verdana, Arial, Helvetica"">Test
Info"
EndLiteral = "</font<br>"
plhTMReview.Controls.Add(Literal(StartLiteral))
plhTMReview.Controls.Add(Literal(EndLiteral))

3. EndLiteral = "</td</tr>"
plhTMRequest.Controls.Add(Literal(EndLiteral))
=====================

In the above case, 1 and 3 do not form a part of the markup but 2
does. Also, 2 is not created as a literal control of a table row/data
but it form a part of placeholder directly. When i right click on the
browser and view source code, it does not contain markup for 1 and 3.

Did i do something wrong? or am i overlooking something?
Can't see anything wrong with what you have posted so far. You revealed
little og the plhTMRequest thing, the problem probably lies there.

--
Anthony Jones - MVP ASP/ASP.NET

Sep 12 '08 #2

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

Similar topics

5
by: Donald Firesmith | last post by:
Are html tags allowed within meta tags? Specifically, if I have html tags within a <definition> tag within XML, can I use the definition as the content within the <meta content="description> tag? ...
20
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
15
by: Craig Hunt | last post by:
I posted this in another newsgroup, so please forgive me if you've already seen it. --- Am I missing something here? Quite frequently, I'll write an aspx document taking care to format the...
4
by: Ganesh Muthuvelu | last post by:
Hello, I was wondering if there is a way to store all the HTML element information in a database and then dynamically generate the HTML code for a page?.. Basically, I do not want to design every...
3
by: Just D. | last post by:
All, What's the simplest way to show my own HTML string on the ASPX page assuming that this page is just created using the wizard and it has nothing on it? We're free to use any control adding...
2
by: _MC_ | last post by:
Hi, i want to structure two elements (each conists of 1 Label and 1 Textbox) in an Table. As I use an Content Place Holder, i thought it is possible to add the table via Controls.add(Literal)....
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
4
by: Andy Fish | last post by:
hi, this is more an html parsing question than an XML question but I think it's the kind of thing that folks in an XML newsgroup would be more likely to help with, so please excuse me if it's a...
0
by: Hetal | last post by:
Hi, I have been working on creating a dynamic table with controls on a ASP.NET webpage and i have been using literal controls to do that. The issue that i am facing is, when i have the Start and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.