Converting a Generic List of Custom Objects & Property to a Formatted (codezest.com)

submitted by daveschinkeldaveschinkel(1720) 3 years, 7 months ago

Today I had the need to take a list of names from a returned list of Custom Objects, and convert one of its properties it to a string that included some HTML. This is nothing fancy, and pretty standard/simple but I thought I’d post about it anyway. Since I did not need a custom ToString() method here to convert all properties of my object, I just created a simple method to iterate through the list of objects and add one of the properties to the StringBuilder object which is ultimately being returned to give me the nice string with HTML.

add a comment |category: |Views: 11

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story