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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:59:50+00:00 2026-06-14T20:59:50+00:00

In one .aspx webpage I have 2 contacts details in two different <div> like

  • 0

In one .aspx webpage I have 2 contacts details in two different <div> like below

<div id="primaryContact"> 
    Name - betty quay 
    Cell - 9867452389
    designation - Build 
</div>

<div id="secondryContact"> 
    Name - francesco maitire 
    Cell - 9867452389
    designation - Build 
</div>

Here I want to show each div on alternate day of a week.
How can I do so, using ASP.NET or Javascript?

  • 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-14T20:59:51+00:00Added an answer on June 14, 2026 at 8:59 pm

    You can do it in C# like this:

        protected void Page_Load(object sender, EventArgs e)
        {
            ShowContactAlternate();
        }
    
        private void ShowContactAlternate()
        {
            if ((int)DateTime.Now.DayOfWeek % 2 == 0)
                primaryContact.Visible = true;
            else
                secondaryContact.Visible = true;
        }
    

    Also make sure that you change your markup to something like this and add runat="server and Visible="False" attributes to divs”:

    <div id="primaryContact" runat="server" Visible="False"> Name - betty quay Cell - 9867452389 designation - Build </div>
    <div id="secondryContact" runat="server" Visible="False"> Name - francesco maitire Cell - 9867452389 designation - Build </div>
    

    EDIT:

    If you want to alternate every week you can do it like this probably:

    Create this helper function:

    private int GetWeekOfYear(DateTime date)
    {
        return CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(date, 
                CalendarWeekRule.FirstFourDayWeek,
                DayOfWeek.Monday);
    }
    

    And you can use it in your if statement inside ShowContactAlternate line this:

    if (GetWeekOfYear(DateTime.Now) % 2 == 0)
    

    As every year has 52 weeks you have to be sure that you don’t run in to trouble every new year. It shouldn’t be a problem to solve.

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

Sidebar

Related Questions

I have one string name as id in my .aspx.cs page and one JavaScript
I have an aspx page with two buttons, one of the buttons has an
I have an Asp .net page like this simple one http://issamsoft.com/app2/page1.aspx and I want
I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation
I have two separate .aspx files that are used in one web page. One
I have one image button in the custom control like below. public string SearchTableName
I have created one aspx Page from that i need to access the property
I have an aspx page with multiple FileUpload controls and one Upload button. In
I have an ASP.net aspx page that's composed of 3 iframes. One for the
How to insert an event to the aspx.cs page. I have one asp:button and

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.