How to use a session variable in the RadioButtonList ListItem text
I am trying to create a Rediobuttonlist:
In the options' text I want to insert a name of organisation which is logged in. I store the name in a Session variable.
So if "A" is loggin in I want them to see:
no longer a member of A but option1
no longer a member of A but option2
no longer a member of A but option3
If "B" is logged in they should see:
开发者_StackOverflow社区no longer a member of B but option1
no longer a member of B but option2
no longer a member of B but option3
and so on ... How can I do that?
Normally I use a label and than in the code I write behind (c#):
label.text = "no longer a member of" + Session["name"]+"but option";
but I can not isert a label to the Radiobutton list text.
Any ideas?
Thanks.
maybe it helps you:
Dictionary<string,string> newlist = new Dictionary<string,string>();
newlist.Add("opt1","no org" +Session["schubles"]+ "but opt bla");
newlist.Add("opt2","no org" +Session["schubles"]+ "but opt blo");
newlist.Add("opt3","no org" +Session["schubles"]+ "but opt blum");
rlist.DataValueField = "key";
rlist.DataTextField = "value";
rlist.DataSource = newlist;
rlist.DataBind();
精彩评论