DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2008
    Posts
    2

    How to Pass a variable from NumericUpDown control to web service

    I am trying to create a textbox that when the user clicks on the up or down arrow a minute will be added or subtracted to/from the time. I created a web service thinking I could pass the current time to methods that add and subtract one minute from the current time. But I am unsure of how to pass a DateTime variable or if I even can.

    Here is my webservice:
    Code:
    [System.Web.Script.Services.ScriptService()]
        public class NumericUpDownService : System.Web.Services.WebService
        {
            [WebMethod]
            public DateTime NextTime(DateTime currentTime)
            {
                currentTime = currentTime.AddMinutes(1);
                return currentTime;
            }
    
            [WebMethod]
            public DateTime PerviousTime(DateTime currentTime)
            {
                currentTime = currentTime.AddMinutes(-1);
                return currentTime;
            }
        }
    and my control:
    Code:
    <cc1:NumericUpDownExtender ID="TimeNumericUpDownExtender" runat="server"
    
    TargetControlID="TimeTextBox" 
    Width="70"
    
    RefValues=""
    
    ServiceUpPath="NumericUpDownService.asmx"
    ServiceDownPath="NumericUpDownService.asmx"

    ServiceUpMethod="NextTime"

    ServiceDownMethod="PerviousTime" >

    </cc1:NumericUpDownExtender>

    How do I pass and get back a datetime object to/from my methods NextTime and PeriousTime? Thanks for any help!
    Last edited by Hack; 12-08-2008 at 07:16 AM. Reason: Added Code Tags

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,651
    Welcome to DevX

    Perhaps using a SOAP Header would work for you.

    http://msdn.microsoft.com/en-us/libr...d5(VS.80).aspx
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Replies: 0
    Last Post: 05-06-2007, 05:31 PM
  2. Replies: 0
    Last Post: 06-21-2005, 11:01 AM
  3. Question on .NET remoting
    By kgoff@worldnet.att.net in forum .NET
    Replies: 2
    Last Post: 01-07-2003, 01:06 PM
  4. Re: Do consumers even want web services?
    By Robert Lantry in forum .NET
    Replies: 278
    Last Post: 03-27-2002, 01:00 PM
  5. Replies: 0
    Last Post: 04-19-2001, 07:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links