473,581 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

force line break inside .InnerText

when setting the InnerText property of a tag such as <span> , how to force a
line break?

Span1.InnerText = "some stuff" & vbCrLf & "some more stuff"

doesn't work ... the vbCrLf just shows up as a null-string
Nov 17 '05 #1
3 8252
John A Grandy wrote:
when setting the InnerText property of a tag such as <span> , how to force a
line break?

Span1.InnerText = "some stuff" & vbCrLf & "some more stuff"

doesn't work ... the vbCrLf just shows up as a null-string

I think you want to use the .InnerHtml property:

Span1.InnerHtml = "some stuff<br>some more stuff"

remember the crlf doesn't do anything in HTML (well, shouldn't, even
though sometimes IE adds a little space).....you need a <BR>

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 17 '05 #2
John A Grandy wrote:
when setting the InnerText property of a tag such as <span> , how to force a
line break?

Span1.InnerText = "some stuff" & vbCrLf & "some more stuff"

doesn't work ... the vbCrLf just shows up as a null-string

I think you want to use the .InnerHtml property:

Span1.InnerHtml = "some stuff<br>some more stuff"

remember the crlf doesn't do anything in HTML (well, shouldn't, even
though sometimes IE adds a little space).....you need a <BR>

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 17 '05 #3
Hi Craig. Thanks for the response.

The reason I wasn't using .InnerHTML is that then I have to use
Server.HTMLEnco de() on the text I want to display ...

.... and I've had strange results in the past using that function.

MySpan.InnerHTM L = Server.HTMLEnco de("some stuff<br>some other stuff")

works fine ... but more complex text can get funky results.

"Craig Deelsnyder" <cd******@NOSPA Myahoo.com> wrote in message
news:uo******** *****@TK2MSFTNG P11.phx.gbl...
John A Grandy wrote:
when setting the InnerText property of a tag such as <span> , how to force a line break?

Span1.InnerText = "some stuff" & vbCrLf & "some more stuff"

doesn't work ... the vbCrLf just shows up as a null-string

I think you want to use the .InnerHtml property:

Span1.InnerHtml = "some stuff<br>some more stuff"

remember the crlf doesn't do anything in HTML (well, shouldn't, even
though sometimes IE adds a little space).....you need a <BR>

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 17 '05 #4

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

Similar topics

4
5811
by: Ralph Freshour | last post by:
I'm trying to insert a newline character into the string below for an <INPUT TYPE="image" ALT= tag but when I hold the mouse over the image I see the string but without a newline break in the string - how do I get the line to break? $php_floating_tip = "Member Name: $php_row2->displayed_member_name \\nPersonality Ranking:...
2
3147
by: Billy | last post by:
I want to make a calendar and add a hyperlink to the days inside the calendar. The source code is below: <body> <SCRIPT LANGUAGE="JavaScript"> var now = new Date();
8
46157
by: Steven | last post by:
i need to force a carriage return with a textarea field at X number of characters. anybody know how to do this? tks
7
3811
by: Sashi | last post by:
Two questions: (1) I can pull the text of an XML element as a string just fine using code as such: strSomeString = myXmlDoc.SelectSingleNode("/Element1/Element2/Element3", myXmlNSMgr).InnerText;
2
2398
by: Yogi_Bear_79 | last post by:
I have a script that parses window.location.hash to figure out which xml file to load. The xml files populate a page on a framed site. The code works correctly to a point. If I have a seperate html page to support each xml it works. I would like to eliminate the individual html pages becuase only one should be needed. When I use one page...
8
12762
by: CJM | last post by:
What is the best way to force a page break when printing from a browser? A page in my application generates a series of tables which are usually less than will fit on a page of A4. Ideally I want to introduce a page break between each table when printing. I'm not sure what options I have available. I know there is some support in CSS but...
2
2298
by: comp.lang.php | last post by:
class ReportGenerator { function ReportGenerator() {} /** * Generate the HTTP headers necessary for this file type. Can be called statically *
0
2688
by: Supriya | last post by:
Hi All, I need to set innerText of a cell element like "line1\nline2" in XML. When I open the xml file in Excel new line in that cell is missing. When I insert new line in cell in Excel using ALT + ENTER and save it is creating innerText "line1 line2".When I tried to set same value to innerText in XML from code, it is converting to...
11
2785
by: estantep | last post by:
Hello, I am trying to find out an alternate way to brute-force a variable length vector with different variable length contents. int chromossome int max_value_for_each_chromossome
0
7876
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...
0
8156
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. ...
0
8310
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...
0
6563
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...
0
5366
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...
0
3809
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...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2307
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
0
1144
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...

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.