BillE said:
Radio buttons or checkboxes don't particularly make sense if the client
requires a granularity in value from 1 to 100.
I agree with the problems with buttons, since I can't prevent autopostback
and wire up a deferred event.
I guess I'll have to use a client side javascript solution, although I
prefer to keep my logic on the server.
*sigh* since you insist on doing it the "fiddly way"
There are plenty of references out there, for building custom controls.
here's a quick 'n dirty ScaleControl.vb
Imports System.ComponentModel
Imports System.Web.UI
<DefaultProperty("Value"), ToolboxData("<{0}:ScaleControl
runat=server></{0}:ScaleControl>")> Public Class ScaleControl
Inherits System.Web.UI.HtmlControls.HtmlInputHidden
<Bindable(True), Category("Appearance"), DefaultValue("0")> Shadows
Property Value() As Integer
Get
Return CInt(MyBase.Value)
End Get
Set(ByVal Value As Integer)
MyBase.Value = Value
End Set
End Property
Protected Overrides Sub Render(ByVal output As
System.Web.UI.HtmlTextWriter)
Dim i As Integer
MyBase.Render(output)
For i = 0 To 99
output.Write(String.Format("<INPUT type=""Button""
value=""{1}"" onclick=""javascript:if(document.getElementById('{0}')){{
document.getElementById('{0}').value = {1} }}; return false;"" />",
Me.ClientID, i))
Next
End Sub
End Class
not pretty, but it'll give you a place to start.
To use, just drop it on a page, like any other control
Hope this helps
-- a --