views:

15

answers:

1

I need to show items like in below image.

alt text

I'm using this code to bind dropdownlist.

var options = (from option in _serviceOptions
                select new
                {
                  OptionId = option.OptionId,
                  OptionText = option.OptionText + " - " + option.Price + "£/month"

                }).ToList();

myDdl.DataSource = options;
myDdl.DataValueField = "OptionId";
myDdl.DataTextField = "OptionText";
myDdl.DataBind();

_serviceOptions is the resultset returned by calling stored procedure using L2S

The problem is, it is again encoding the & to & before rendering to the browser.

+1  A: 

Use the pound sign £ instead of £. It works here. The £ will be converted to £ which is equal to £.

var options = (from option in _serviceOptions
                select new
                {
                  OptionId = option.OptionId,
                  OptionText = option.OptionText + " - " + option.Price + "£/month"

                }).ToList();
lasseespeholt
How do I type pound character in Visual Studio?
Ismail
Copy the sign or code from my post :) or in unicode like: "\u00a3"
lasseespeholt