Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi I want to dispaly the name of the items in seperate lines..
my code is :
if (!countForChildSupplier.Equals(SysXConsts.NONE))
               {
                   errorMessage = "Please reject these supplier changes as listed child supplier(s) is/are already mapped with other supplier(s)." + Environment.NewLine;
                   duplicateChildSuppliers.ForEach(item =>
                       {
                           errorMessage = errorMessage + item + Environment.NewLine;
                       });
                   errorMessage = errorMessage.Substring(SysXConsts.NONE, errorMessage.Length - SysXConsts.ONE);
                   errorMessage = errorMessage + "." + Environment.NewLine;
               }


but it is not working
Posted
Comments
Timberbird 19-Nov-12 6:48am    
Where do you output errorMessage? If you write it to log/console/Windows form, everything should work. If you want to display this message in browser, use <br/> instead of Environment.NewLine
pree_kh 19-Nov-12 6:58am    
Actually i am displaying it on windows form..
and for ex. i need to display. ABC
XYZ
123
I m getting 123ABC123XYZ123123.
Timberbird 19-Nov-12 7:04am    
Which control do you use for output?
Timberbird 19-Nov-12 7:23am    
Oh, and by the way - in this case you shouldn't mark your question with ASP.NET tag, it's rather misleading :)
pree_kh 19-Nov-12 7:13am    
list box

1 solution

I used the tag and it worked:

C#
string errorMessage = "Please reject these supplier changes as listed child supplier(s) is/are already mapped with other supplier(s).</br>";

for(int i=0;i<4;i++){

errorMessage =errorMessage + "Item"+i+"</br>";

} literal.Text=errorMessage;

}



Thanks
Jyotish
 
Share this answer
 
Comments
pree_kh 19-Nov-12 23:00pm    
thanxx it worked:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900