Huh?
Not to be mean, but that is a complete Hack.
I think what your missing is the "Text" property.
Here is a sample:
=============== aspx code
<form id="Form1" method="post" runat="server">
<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate >
<table border="1">
</HeaderTemplate>
<ItemTemplate >
<tr>
<td>
<asp:CheckBox id="chkA" runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "friendlyname2" ) %>' Checked='<%#
DataBinder.Eval (Container.Data Item, "isCool") %>'></asp:CheckBox>
</td>
<td>
<%# DataBinder.Eval (Container.Data Item, "friendlyname1" ) %>
</td>
</tr>
</ItemTemplate>
<FooterTemplate >
</table>
</FooterTemplate>
</asp:Repeater>
</form>
== end .aspx code
========== code behind page (in vb.net)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
If Not (Page.IsPostBac k) Then
Me.Repeater1.Da taSource = Me.GetDataSet1( )
Me.Repeater1.Da taBind()
End If
End Sub
Private Function GetDataSet1() As DataSet
Dim ds As New DataSet
Dim sb As New System.Text.Str ingBuilder
sb.Append("<?xm l version=""1.0"" ?><items>")
sb.Append("<ite m>")
sb.Append("<ite mid>300</itemid>")
sb.Append("<fri endlyname1>Meat s</friendlyname1>" )
sb.Append("<fri endlyname2>MT</friendlyname2>" )
sb.Append(("<ti me>" + DateTime.Now.To LongTimeString( ) +
"</time>"))
sb.Append("<isC ool>true</isCool>")
sb.Append("</item>")
sb.Append("<ite m>")
sb.Append("<ite mid>100</itemid>")
sb.Append("<fri endlyname1>Vege tables</friendlyname1>" )
sb.Append("<fri endlyname2>VG</friendlyname2>" )
sb.Append(("<ti me>" + DateTime.Now.To LongTimeString( ) +
"</time>"))
sb.Append("<isC ool>false</isCool>")
sb.Append("</item>")
sb.Append("<ite m>")
sb.Append("<ite mid>200</itemid>")
sb.Append("<fri endlyname1>Frui ts</friendlyname1>" )
sb.Append("<fri endlyname2>FR</friendlyname2>" )
sb.Append(("<ti me>" + DateTime.Now.To LongTimeString( ) +
"</time>"))
sb.Append("<isC ool>true</isCool>")
sb.Append("</item>")
sb.Append("</items>")
Dim ms As New System.IO.Memor yStream
Dim writer As New System.IO.Strea mWriter(ms)
writer.Write(sb .ToString())
writer.Flush()
ms.Position = 0
ds.ReadXml(ms)
Return ds
End Function 'GetDataSet1
=== end vb.net code behind
PS
My method for generating a DS is for EXAMPLE's only.
It is not a good way to do it. (Just in case somebody sees this for a
non checkbox question)
...
LisaBigJax wrote:
I am using a series of checkbox's in a repeater -- (not the
checkboxlist) -- the problem I am encountering is that the checkbox
does not have a value attribute. I tried to add it via the
"InputAttribute " however it doesn't seem to hold state on a postback.
Is there any reason why I can't use the ToolTip attribute of the
CheckBox control to store data? Then retreive it via another page?
Here's a visualization of what I am trying to accomplish.
CHECK YOUR WEBSITE FEATURES
[x] Flash
[x] Streaming Video
[ ] Search Engine Optimization
[ ] Extra-Bandwidth
Because checkbox values only hold "true | false", I'd like to use the
ToolTip attribute to hold the "value" attribute of the selection - like
a listitem in a checkboxlist or value in the radio button.
Are there any drawbacks to this? Browser issues?