Click here to Skip to main content
Rate this: bad
good
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 0:21am
pree_kh791
Comments
Timberbird at 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 at 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 at 19-Nov-12 7:04am
   
Which control do you use for output?
Timberbird at 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 at 19-Nov-12 7:13am
   
list box
Timberbird at 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 at 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
0 OriginalGriff 395
1 DamithSL 218
2 Sergey Alexandrovich Kryukov 215
3 Dave Kreskowiak 200
4 Maciej Los 195


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