Click here to Skip to main content
15,893,508 members

 
Share this answer
 
Comments
SAPTARSHI SENGUPTA 14-Jun-15 12:57pm    
sir i watch the tutorial but i was confused that how can i use this,
My project is a a medcine shop
here user entry the manufacture date and expiry date.Before 30 days of expiry date he wants to notification or watch in grid view that thoes records are red,plzz help me
You have to write your query accordingly. While fetching records add a condition to pass the current date and apply logic in query.
SAPTARSHI SENGUPTA 15-Jun-15 3:53am    
thank you very much.sir.
is their any process to show message alert
You can show alert from code behind, else you can use JavaScript alert. Depends upon your requirements. Have you tried?
SAPTARSHI SENGUPTA 15-Jun-15 5:22am    
yes it is sucessfull.but i want to know that is their any process to show message alert like window application (your trial is remaning 30 days).i want to show in asp.net
try this .....
C#
DateTime today = DateTime.Today.Date;
DateTime expiryDate = Convert.ToDateTime("07/18/2015");

TimeSpan days = expiryDate - today;
double Day = Convert.ToDouble(days.TotalDays);
if (Day < 30)
{
    Label1.ForeColor = System.Drawing.Color.Red;
}
else
{
    Label1.ForeColor = System.Drawing.Color.Green;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900