.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Paragraph and Line Break Characters

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :ASP.Net
Hello Everyone. While coding my website, I ran into a strange oddity that I can not figure out.  I was working with the MasterPages file and had some fat fingers, thus hitting a few strange keys.  I don't have any idea which ones they were exactly.  After continueing on the coding, I later noticed that my paragraphs were not displaying as they usually do.  Normally, I can have the following code:<p />This is paragraph one. <p />This is paragraph two.  This would show up like a standard set of paragraphs, with a single empty line in between.  After hitting the unknown keys in Visual Studio, the paragraphs no longer work as expected.  I've had to change my HTML to...<p>This is paragraph one.</p> <br /> <p>This is paragraph two.</p> I'm not particularly opposed to either way, however, the problem has arisen that the page viewed over my mobile phone doesn't view the same as over the computer.  There are now several extra lines between paragraphs.   What did I do wrong?  I've recreated the page from scratch and I've looked at all the properties I can find.  Google has been no help at all. Thanks in advance! P.S.  You can see the exact same page displayed Content Text using different MasterPages atHttp://Www.McsoPosseResources.Org/Http://Www.McsoP

View Complete Post

More Related Resource Links

Line Break Problem in XSLT


Hi All,

I want to add line break in the xslt but it not working.

Below is the code for adding the line break.

</P> <P>
&lt;xsl:variable name="Collection7"&gt;</P> <P>&nbsp; &lt;xsl:value-of select="$13932"/&gt;&lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;</P> <P>&nbsp; &lt;xsl:value-of select="$31042"/&gt;&lt;xsl:text&gt;&amp;#xa;&lt;/xsl:text&gt;</P> <P>&lt;/xsl:variable&gt;</P> <P>&lt;td&gt;&lt;xsl:value-of select="$Collection7"/&gt;&lt;/td&gt; </P> <P>&lt;/code]</P> <P>I have tried the below code as well:</P> <P>&lt;xsl:variable name="newline"&gt;
&lt;/xsl:variable&gt;</P> <P>or</P> <P>&lt;xsl:variable name="break"&gt;&amp;lt;br&amp;gt;&lt;/xsl:variable&gt;</P> <P>or </P> <P>addign &lt;br/&gt;</P> <P>then also it not adding the line break.</P> <P>But If I write code like below then it is adding the line break and it works fine.</P> <P>

REGEX does not match when line ends with the characters.. also, how to negate words that contain the

\S*(ai|ie)\S*   seems to match all words with characters ai and ie in them.  However it does not match if the line ends with them, how can fix that?Also, how can I match all words that DO NOT contain those characters.. I've tried ?! and [^ to no avail.Thanks in advance for any help or information!

regular expression: Read a multi line paragraph

I am trying to build a regular expression that will capture a paragraph of any length that starts with "Ordinance Summary:" and ends with "<=>" but doesn't actually include them in the selection.  And I need it to stop at the first instance of <=>. Here is an example of what what I might encounter: "Ordinance Summary: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin pharetra nonummy pede. Mauris et orci. Aenean nec lorem.<=> Ordinance Sponsor:Rhuarch<=>"   And here is what I would need it to actually capture: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin pharetra nonummy pede. Mauris et orci. Aenean nec lorem.   And here is the expression I tried which didn't work: (?<=Ordinance Titl

SQL data type for HL7 message retaining carriage return and new line characters

Hi, What data type should be used for a column storing text as descripted in title? Please advise. I crrently have the message stored as text, but if I copy the message from studio management to a notepad, it will be come one big line of text instead.  

Line Break within a Cell?

I am creating a "contract" via SRS 2008 in which I will pass contract sections as text into a table on the report.  In some cases the cell within the table will have 4-5 lines of text.  In other cases the cell may have 70 - 80 lines of continuous verbiage.  How do I get the report to page break and put some of the text on 1 page and the rest on a second page?

Line break after div, but not before



I have list of products that I want to display in a list with three products on each row and I want to use plain css, not a table based design.

I've tried a class with display:block on every third product, and with display:table-cell on the products before. Can you do a line break after a div, but not before?

I know that a table would be best, but due to certain circumstances this is not an option.

Best regards,

how to break line while assigning value using Javascript


hi all ;

i ve a string like

var Ans="a<br>b<br>c";

wen i assigned input using document.getElementById(id).value = Ans;

it display input as it is

i wanna show input lyk 




i am tryin to replace <br>wit "\n" but it is not working... it is showing 

a<br>b<br>c or


Insert "

" at each line break in a rich text box c# 2010


I want to type a letter in a rich text box and have it converted to html format for bulk email send to customers. Ideally I want to add "</p><p> at each line break, but right now i'd be happy to simply replace the line breaks.

When i run the text through

Int32 n = 0;

string s = EmailBodyRichTextBox.Text;

string t = "";

foreach (char c in s)

how to save normal & special mix characters set (paragraph) in vb and also save specific valuses for

I want some help.....
How to save normal & special mix characters set (paragraph) in vb and also save specific values for normal&special mix characters sets.

Basically i have a text of special,normal,alphabetic and numeric values.
Like this:
This is text which i am saying:

[<b></b>ÿÛ C  $.' ",#(7),01444'9=82&lt;.342ÿ2!!22222222222222222222222222222222222222222222222222ÿÀ  P b" ÿÄ       ÿÄ µ   }

how to set break point at inline code

I set the element height value by using inline code 
<%# Eval("s") %>
where "s" is the variable declared in page load event. when i run the application it don't set the height. 
Is there any way, i can set break point into .aspx file. i mean how i can check if my Eval("s") get the value.  

Article commenting by line number


I'm wondering what's the best way to approach an online article system that allows users to comment by clicking on the line they are commenting about? Essentially the same way Adobe Acrobat works with comments where you can click anywhere and the text is saved for that location.

I'm assuming a mix of jQuery would be the crux of the interface. The system would need to save comments so that when another user logs in, they will also see the other comments but they can´t edit them - only add their own.

Any suggestions would be great.

New off line application working with sdf file. Need advice


Hey Folks

I am working on a project currently where I need to get data out of a 3rd party vendor's software that uses a .sdf file I looked this up and its a SQL CE file. I was hoping to just link to with with access but thats apparently not going to happen. I need to link to the database extract data from it to a csv file for later use. I also and most important I need to get the data from it and create a report that can be printed while on a customers site that my or may not have web access so I need for this program to be on and off line. I had my webapplication that I have been working on open and was able to bring up the sdf file under the server exploere however I can't seem to get anything out of it when I try to do grid views or detail views errors out.

Can I use one of Visual Studio projects to create this sort of applicaiton if so what would be the best approach. I would love to get an access odbc driver since office is allready installed on the employee's laptop's



Problem Cleaning Illegal Characters out of an XML String



I'm trying to strip illegal characters out of an XML string before I send it off to a public web service.  The xml will look something like this:

<field name="first_name">George</field>
<field name="last_name">Harrison</field>
<field name="notes">This is a note.  Any character could appear here</field>

I need to pull out any ampercand (&) charachters in the any of the fields, as well as any < or > characters, which would make the XML unreadable.

I've tried it like this:

Private Shared Function cleanQuery(ByVal queryNode As String) As String 
    Dim root As XElement = XElement.Parse(queryNode) 
    For Each x As XElement In root.Elements 
        x.Value = x.Value.Replace("&", "&").Replace("<", "<").Replace(">", ">") 
    Return root.ToString() 
End Function


That doesn't work so well.  I get the error stating:

     There are multiple root elements. Line 1, position 15.

I tried wrapping the XML in a single root element, like this:

Private Shared Function cleanQuery2(ByVal q

IE 8 Issues with Chinese/Japanese Characters


On my web application, I display information in different languages. Everything works fine in IE compatibility mode and FireFox but it shows boxes for chinese/japanese languages. I am pretty much having the same issue as described here



Thanks for your help.

Store and display Japanese characters



Can anyone tell me the best way of storing Japanese characters through ASP.NET.
I have to put characters into a asp:textbox on one page, which saves it to an Access DB.
On a second page I want to display the content in a asp:label.

Should I store the characters directly to the database or should they be encoded, and
how do I encode the characters? 

In my web.config i have:

<globalization fileEncoding="ISO-2022-JP" requestEncoding="ISO-2022-JP" responseEncoding="ISO-2022-JP" culture="ja-JP" uiCulture="ja-JP" />  

On the display page I have:

<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=shift_jis">


crystal report -visual studio 2008 dual axis chart (bar & line)


dear all, 

i use crystal report integrated with  vs.2008, and i want to make chart with dual axis (bar & line).

i have used bar chart and input the data with 2 values..

then in chart options > template, i activated the dual axis..

my question is, how i can change the 2nd value with line chart not bar chart??

i'd tried to find the right settings in "chart options" but still can't find the solution.

for information in "chart options" there are 4 sub menu : template, general,titles,grid..

i read in a tutorial there's more sub menu called "series" in crystal report (stand alone version)..

is it possible doing it in Crystal Report VS. 2008?

please,, i need your advice and solution..

Thanx before..


string.Split - not all characters allowed as separator



I am working on a site where I use the Split function on a string.

To make sure I used a separator character that I do not use anywhere in the data I selected the character '£'.

This worked fine in Firefox and Safari, but in IE8 I get an 'Index out of range' error, so apparently the '£' character is not handled correctly.

I changed the separator to ';', and then it works fine.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend