Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8377967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:48:34+00:00 2026-06-09T15:48:34+00:00

I use WebClient class to send a response acknowledge message in an mvc 3

  • 0

I use WebClient class to send a response acknowledge message in an mvc 3 project. Message is sending from one action method on a project to another projects action method.
Surprisingly the date parameter is 3 hours later, on recieving data.

For example if my sending date is receving data is “2012-08-14 13:42:50Z” i see “2012-08-14 16:42:50Z” on the other side.
Here is a simplified code sample of my case;

NameValueCollection ack = new NameValueCollection();
ack.Add("RESID", form.RESPONSE.ID.ToString());
ack.Add("A_DateTime", DateTime.Now.ToString("u")); //2012-08-14 13:42:50Z

using (var client = new WebClient())
{
    client.Encoding = System.Text.Encoding.UTF8;
    var result = client.UploadValues("http://localhost:11578/HPM/ResponseAck", ack);
}



//HPM Controller:
ResponseAck(HttpPostResponseAckMessage response)
{
    //Here response.Date vale is 2012-08-14 16:42:50Z  ???
}

It seems to me its about sneaky little serialization monsters changing it cause of some culture specific issue. But i don’t know the real cause so the solution.

Edit:

public class HttpPostResponseAckMessage
{
    public int RESID { get; set; }

    public DateTime A_DateTime { get; set; }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:48:36+00:00Added an answer on June 9, 2026 at 3:48 pm

    Ok, I think its about expecting mvc model binder to parse a formated datetime.

    With the “u” format model binder thinks the datetime is UTC.

    So my solution will be changing the type of property A_DateTime to string and will parsing it internaly.

    Hope this helps someone else like me.
    Thanks all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the WebClient class to download a html file from another
In my application I use the WebClient class to download files from a Webserver
In .NET (for Windows Phone), I'm trying to use the WebClient class to send
i have an application that loads the page content. I use the WebClient class.
I have an ASP.NET MVC application that currently uses the WebClient class to make
We have a situation where we use the WebClient class to download some data
When I use: WebClient web = new WebClient(); web.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChangedWeb); web.DownloadFileAsync(new Uri(http://www.website.com/Webs.exe),
Like the title says, I'm wondering if the use of WebClient is the proper
I'm developing simple Windows Service sending and receiving data from remote web service. I
I don't know enough about VB.Net yet to use the richer HttpWebRequest class, so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.