image with RadioButtonList c## DotNet - 窗口里的风景
A*n
1 楼
I have a table, it include image name and image.(I save the image to the
database).
I get the image from the database, but how can I bind the image to the
radiobuttonlist? (note: I save the image to the database not folder, so no
image path)
my Code:
var queryforlogo = from a in context.Logoes
where a.DataBaseGroupId == gt.DataBaseGroupId
select a;
if (queryforlogo.Count() > 0)
{
foreach(Logo logo in queryforlogo)
{
byte[] data = logo.Image;
rblLogo.Items.Add(new ListItem(String.Format("<
img scr='{0}'>",data)));
}
}
I think "rblLogo.Items.Add(new ListItem(String.Format("",data
)));
" is not working.
any idea?
Thanks
database).
I get the image from the database, but how can I bind the image to the
radiobuttonlist? (note: I save the image to the database not folder, so no
image path)
my Code:
var queryforlogo = from a in context.Logoes
where a.DataBaseGroupId == gt.DataBaseGroupId
select a;
if (queryforlogo.Count() > 0)
{
foreach(Logo logo in queryforlogo)
{
byte[] data = logo.Image;
rblLogo.Items.Add(new ListItem(String.Format("<
img scr='{0}'>",data)));
}
}
I think "rblLogo.Items.Add(new ListItem(String.Format("",data
)));
" is not working.
any idea?
Thanks