AjaxControlToolKit 学习之:NumricUpDown

前台代码:
    <asp:ScriptManager id="ScriptManager1" runat="server">
    
</asp:ScriptManager>
    
<asp:UpdatePanel id="UpdatePanel1" runat="server">
        
<contenttemplate>
           
<asp:TextBox id="TextBox1" runat="server" Width="120" Text="3"></asp:TextBox><br />
           
<asp:TextBox id="TextBox2" runat="server" Width="120px"></asp:TextBox><br />
           
<asp:TextBox id="TextBox3" runat="server" Width="120px"></asp:TextBox><br />
           
            
<ajaxToolkit:NumericUpDownExtender id="NumericUpDownExtender2" runat="server" Width="120" TargetButtonUpID="" TargetButtonDownID="" ServiceUpMethod="" ServiceDownMethod="" RefValues="" TargetControlID="TextBox1"></ajaxToolkit:NumericUpDownExtender>
            
<ajaxToolkit:NumericUpDownExtender id="NumericUpDownExtender1" runat="server" Width="120" TargetButtonUpID="" TargetButtonDownID="" ServiceUpMethod="" ServiceDownMethod="" RefValues="一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月" TargetControlID="TextBox2"></ajaxToolkit:NumericUpDownExtender>
            
<ajaxToolkit:NumericUpDownExtender id="NumericUpDownExtender3" runat="server" Width="120" TargetButtonUpID="" TargetButtonDownID="" ServiceUpPath ="NumericUpDown.asmx" ServiceDownPath="NumericUpDown.asmx" ServiceUpMethod="nextValue" ServiceDownMethod="prevValue" RefValues="" TargetControlID="TextBox3"></ajaxToolkit:NumericUpDownExtender>
        
</contenttemplate>
    
</asp:UpdatePanel>
    

webService:
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Web.Script.Services.ScriptService()> _
Public Class NumericUpDown
    
Inherits System.Web.Services.WebService

    
<WebMethod()> _
    
Public Function prevValue(ByVal current As Int32, ByVal tag As StringAs Int32  '
        If current >= 3 Then
            current 
= current - 3
        
End If

        
Return current
    
End Function

    
<WebMethod()> _
    
Public Function nextValue(ByVal current As Int32, ByVal tag As StringAs Int32  '

        current 
= current + 3
        
Return current
    
End Function


End Class
posted @ 2008-01-08 15:22  koolay  阅读(203)  评论(0)    收藏  举报