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?
You can do it in C# like this:
Also make sure that you change your markup to something like this and add
runat="serverandVisible="False"attributes to divs”:EDIT:
If you want to alternate every week you can do it like this probably:
Create this helper function:
And you can use it in your if statement inside
ShowContactAlternateline this: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.