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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:21:10+00:00 2026-06-02T16:21:10+00:00

I created a calender with render option. It works perfectly on my local machine

  • 0

I created a calender with render option. It works perfectly on my local machine but it does not work on the server. I showed employee time sheet in a calender its working fine in local machine. But now i am published on the server its not working there.

My partial code is here:

if (e.Day.Date.Month == DateTime.Now.Month - 1)
{
    if ((lblfromdate.Text != "") && (lbltodate.Text != ""))
    {
        if (e.Day.Date < Convert.ToDateTime(lblfromdate.Text))
        {
            e.Cell.Text = string.Empty;
            e.Cell.BorderColor = System.Drawing.Color.White;
        }
        else
        {
            DataSet4TableAdapters.sp_getallholidayinfoTableAdapter TA = new DataSet4TableAdapters.sp_getallholidayinfoTableAdapter();
            DataSet4.sp_getallholidayinfoDataTable DS = TA.GetData();
            if (DS.Rows.Count > 0)
            {
                DataView DV = new DataView();
                DV = DS.DefaultView;
                string fromdate = Convert.ToString(lblfromdate.Text.Substring(5, 2) + "-" + lblfromdate.Text.Substring(8, 2) + "-" + lblfromdate.Text.Substring(0, 4));
                string todate = Convert.ToString(lbltodate.Text.Substring(5, 2) + "-" + lbltodate.Text.Substring(8, 2) + "-" + lbltodate.Text.Substring(0, 4));
                DV.RowFilter = "fldfromdate >=#" + fromdate + "# and fldfromdate <=#" + todate + "#";
                if (DV.Count > 0)
                {
                    string indate = Convert.ToString(DV[0]["fldfromdate"]);
                    string input = indate.Substring(6) + "-" + indate.Substring(0, 2) + "-" + indate.Substring(3, 2);
                    if (Convert.ToString(e.Day.Date.ToShortDateString()) == input)
                    {
                        e.Cell.Controls.Clear();
                        e.Cell.Text = "Holiday";
                        e.Cell.BackColor = System.Drawing.Color.BlueViolet;
                    }
                }
            }
        }
    }
}

My design code:

<asp:Calendar ID="Calendar2" runat="server" BackColor="White"
    BorderColor="Black" BorderWidth="2px" Enabled="False"
    Font-Names="Verdana" Font-Size="9pt" ForeColor="Black"
    Height="183px" NextPrevFormat="FullMonth" ShowGridLines="True"
    Width="659px" OnDayRender="Calendar2_DayRender" ShowNextPrevMonth="False">

    <DayHeaderStyle BackColor="#6699FF" BorderStyle="Solid"
        Font-Bold="True" Font-Size="8pt" />

    <NextPrevStyle Font-Bold="True" Font-Size="8pt"
        ForeColor="#333333" VerticalAlign="Bottom" />

    <OtherMonthDayStyle ForeColor="#999999" />

    <SelectedDayStyle ForeColor="White" />

    <TitleStyle BackColor="White" BorderColor="Black" BorderStyle="None"
        Font-Bold="True" Font-Size="12pt" ForeColor="#333399" />

</asp:Calendar>
  • 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-02T16:21:11+00:00Added an answer on June 2, 2026 at 4:21 pm

    Double check the Regional settings on the server compared to your development server.

    Usually when you are building dates as strings from strings, and then your servers change from one region to another, there will be problems with date formats

    So if you are building a string for “dd-MM-yyyy” then the server might be looking for “MM-dd-yyyy”

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

Sidebar

Related Questions

I created a Custom Day Render and I would like to access some custom
I'm trying to remove all reports from a list, which are not created in
I've created a calendar which works fine, using a GridView which has an OnClickListener.
The problem is: On postback, the table does not have the rows that were
I created a calendar with Datepicker, but recently I'm having some trouble with it.
I created a custom calendar for my calendar app ... but I have some
I looking to create a custom calender with Zend Framework, I am hoping that
Here's our scenario: We've created a sharepoint 2007 calendar on our intranet site We
we are trying to create a calendar function in python. we have created a
I am building an Day View calendar app. I have already created the empty

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.