Click here to Skip to main content
12,079,489 members (62,903 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
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 19-Nov-12 1:21am
pree_kh791
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
Timberbird 19-Nov-12 7:21am
   
Then you should add each line as a separate item in Items property. BTW, how do you assign the text now - listBox1.Items.Add(errorMessage);?

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I used the tag and it worked:

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
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160212.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100