This Way:
<form id="form1" runat="server">
<div>
Date of Birth
<asp:TextBox ID="txtDateOfBirth" runat="server" /><br />
<asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="DateChanged"></asp:Calendar>
<asp:Label Text="Zodiac" runat="server" />
<asp:TextBox ID="txtZodiac" runat="server" /><br />
<asp:Button Text="btnFindZodiac" OnClick="FindZodiac" runat="server" />
</div>
</form>
C#:
protected void DateChanged(object sender, EventArgs e)
{
this.txtDateOfBirth.Text = Calendar1.SelectedDate.ToShortDateString();
}
protected void FindZodiac(object sender, EventArgs e)
{
string[] date = txtDateOfBirth.Text.Split('-');
Findzodiac(date[1], Convert.ToInt32(date[0]));
}
private void Findzodiac(string month, int day)
{
string str = string.Empty;
if (((month == "Mar") && (day >= 21 || day <= 31)) || ((month == "Apr") && (day >= 01 || day <= 20)))
{
txtZodiac.Text = "Aires";
}
if (((month == "Apr") && (day >= 21 || day <= 31)) || ((month == "May") && (day >= 01 || day <= 21)))
{
txtZodiac.Text = "Taurus";
}
if (((month == "May") && (day >= 21 || day <= 31)) || ((month == "Jun") && (day >= 01 || day <= 21)))
{
txtZodiac.Text = "Gemini";
}
if (((month == "Jun") && (day >= 22 || day <= 31)) || ((month == "Jul") && (day >= 01 || day <= 22)))
{
txtZodiac.Text = "Cancer";
}
if (((month == "Jul") && (day >= 23 || day <= 31)) || ((month == "Aug") && (day >= 01 || day <= 22)))
{
txtZodiac.Text = "leo";
}
if (((month == "Aug") && (day >= 23 || day <= 31)) || ((month == "Sep") && (day >= 01 || day <= 21)))
{
txtZodiac.Text = "Virgo";
}
// in the same way you search fot other
}
I have refer this Zodiac dates from this website
http://answers.yahoo.com/question/index?qid=20091204113202AAMOyBs
Aries (21 March-20 April)
Taurus (21 April-21 May)
Gemini (22 May-21 June)
Cancer (22 June-22 July)
Leo (23 July-22 August)
Virgo (23 August-21 September)
Libra (22 September-22 October)
Scorpio (23 October-21 November)
Sagittarius (22 November-21 December)
Capricorn (22 December-20 January)
Aquarius (21 January-19 February)
Pisces (20 February-20 March)
i have find the zodiac date till virgo you can add the sode for other month in using if condtion.