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 3801074
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:59:31+00:00 2026-05-19T13:59:31+00:00

I have tested a web application I have built using MVC 2 on local

  • 0

I have tested a web application I have built using MVC 2 on local servers (both casini and IIS 7.5).
However when I deploy the application to the windows 2008 server standard edition (also running IIS 7.5) I am receiving unexpected results.

The issue is that i have a controller specified to display graphs using Fusion Charts by writing xml data to files.

When the application is deployed, everything works (switching profiles/viewing month-year scale), but when i try to specify a date range the application loads as if nothing happened while making the first xml entry value to a 0.

This does not happen in my local servers, I do not receive any errors at either deployed or local servers.

Here are the relevant part of code that might be able to solve this issue.

The action method:

 public ActionResult Index(string clientProfile, string domainProfile, string period, string sDate, string eDate)
 {
    if (period == "Month")
            {

                if (!string.IsNullOrEmpty(sDate) && !string.IsNullOrEmpty(eDate))
                {
                    var strXML = seoService.GraphForTrafficCountForDomain(clientProfile, sDate, eDate);

                    System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "/FusionCharts/Data/Traffic.xml", strXML);
                }
                else
                {
                    var strXML = seoService.GraphForTrafficCountForDomain(clientProfile);

                    System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "/FusionCharts/Data/Traffic.xml", strXML);
                }
            }
            else if (period == "Year")
            {

                var strXML = seoService.GraphForVisitsCountForDomainGroupByYear(clientProfile);

                System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "/FusionCharts/Data/Traffic.xml", strXML);
            }

            return View();
 }

The service function:

public string GraphForTrafficCountForDomain(string domain, string sDate, string eDate)
{
            var profile = profileService.GetProfileByDomain(domain, null);

            string strXML = "";

            var StartingDate = DateTime.Parse(sDate);
            var EndingDate = DateTime.Parse(eDate);

            var data =
           repository.FindAll<TrafficData>(x => x.ProfileId == profile.Id && x.Date >= StartingDate && x.Date <= EndingDate).OrderByDescending(d => d.Date).ToList();

            strXML += @"<?xml version=""1.0"" encoding=""utf-8"" ?>";
            strXML += @"<graph caption="""" subcaption="""" xAxisName=""Month"" yAxisName=""Traffic"" decimalPrecision=""0"" formatNumberScale=""0"">";

            for (DateTime date = StartingDate; date.Date <= EndingDate; date = date.AddMonths(1))
            {
                var startDate = new DateTime(date.Year, date.Month, 1);
                var endDate = new DateTime(date.AddMonths(1).Year, date.AddMonths(1).Month, 1).AddDays(-1);

                int value = 0;
                if (data.Any(x => x.Date >= startDate && x.Date <= endDate))
                {
                    value = data.Where(x => x.Date >= startDate && x.Date <= endDate).Select(d => d.TrafficCount).Sum();
                }

                strXML += String.Format(@"<set name=""{0}"" value=""{1}"" hoverText=""{2}""/>",
                                           date.ToString("MM-yy"), (value == 0) ? "0" : value.ToString(),
                                           (value == 0) ? "0" : value.ToString() + " " + date.ToString("MM-yy"));
            }

            strXML += @"</graph>";

            return strXML;
}

I am also attaching an image containing the correct output and the wrong output.

Output Image

  • 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-05-19T13:59:32+00:00Added an answer on May 19, 2026 at 1:59 pm

    The issue was differences between server culture for some reason (even when the server is hosted at the same country as i reside).

    the DateTime Object was not parsing correctly.

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

Sidebar

Related Questions

I have an Asp.net MVC2 web application. I built the application using VS2008 and
We have a web application that can be tested using Selenium , but that's
I have an ASP.NET MVC 3 .NET application under Visual web developer Express 2010.
I have developed an web application using Asp.net ( .Net Framework 3.0). In this
I have tested all my systems developed in Delphi (in Windows XP) on Wine
I have tested the below script on a demo page which is not using
have not tested on windows. but in ubuntu when u disconnect from the network,
I am building a Web Application in ASP.NET 4.0, using VS 2010 Professional. I
I have a web application that is integrating with Twitter's OAuth API. I registered
I have a huge web application and I want to use a system which

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.