Hi Peter,
I think you're going to run into trouble because you're trying to make HTML
do something that it wasn't intended to do. Rather than mess with illegal
attributes, how about just separating the values with a pipe (|) or other
character and then parsing the selected value.
Here's some samble code in VB (VS 2005). Let us know if it helps?
Ken
Microsoft MVP [ASP.NET]
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub RadioButtonList 1_SelectedIndex Changed _
(ByVal sender As Object, ByVal e As System.EventArg s)
Dim myvalue As String()
myvalue = Split(RadioButt onList1.Selecte dItem.Value, "|")
Label1.Text = "myvalue1=" & myvalue(0) & " : myvalue2=" & myvalue(1)
End Sub
</script>
<html>
<head runat="server">
<title>Multi List</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButto nList id="RadioButton List1" runat="server"
AutoPostBack="T rue"
OnSelectedIndex Changed="RadioB uttonList1_Sele ctedIndexChange d">
<asp:ListItem Value="x|y">Ite m 1</asp:ListItem>
<asp:ListItem Value="a|b">Ite m 2</asp:ListItem>
<asp:ListItem Value="g|h">Ite m 3</asp:ListItem>
</asp:RadioButton List><br />
<asp:Labe l ID="Label1" runat="server"> </asp:Label></div>
</form>
</body>
</html>
"Peter" <sp**@nospameri no.com> wrote in message
news:pP******** *************** *******@comcast .com...
Hello,
One thing I am looking to do is to create a couple of different custom
Web Controls that can give me added options when specifying them
in an ASP.NET page. For example:
<asp:RadioButto nList id=RadioButtonL ist1 runat="server">
<asp:ListItem myvalue1="x" myvalue2="y">It em 1</asp:ListItem>
<asp:ListItem myvalue1="a" myvalue2="b">It em 2</asp:ListItem>
<asp:ListItem myvalue1="g" myvalue2="h">It em 3</asp:ListItem>
</asp:RadioButton List>
What I did was to create a custom Web Control and created get/set
statements
for myvalue1 and myvalue2. I actually placed the value of the
DataTextField
into a HashTable so the value I was setting could be stored and retrieved
depending on the listItem and/or what was selected. I am having problems
getting
this to work. Am I concentrating on the right area to get this all to
work?
Thanks,
Peter