开发者

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜