Hello All,
I am developing a web application in which i have two textboxes named dateofcheckin and dateodcheckout. now i want to do is that if the date entered in dateofcheckin is greater than a date entered in dateofcheckout then a messagebox must have to appear showing a perticular message.So please anybody send me the code for this case.its hurry for me and please remember that i am working in a web application so MessageBox.Show() is not working.
My email ids are
Thanks & Regards
Prashant S.More
Bechir BejaouiPosted Dec 24, 2008, 10:32 AM
DateTime d2 = DateTime.Now;
if (d2 > d1) MessageBox.Show(d2.ToString("D") + " is the greater day");
Amit DhaniaPosted Dec 24, 2008, 6:50 AM
You can use code given below:-
if(condition==true)
{
StringBuilder sb = new StringBuilder();
sb.Append("alert('Please type your custom message here.');");
//Parameter passed in below methods:gridView1-you can put name of form here or other control
ScriptManager.RegisterStartupScript(gridView1, GetType(), "custom_alert", sb.ToString(), true);
}
it will make you to show custom message on website like we have window.show("custom message") in desk top application.
Mahesh ChandPosted May 28, 2008, 9:59 AM
check this:
http://www.c-sharpcorner.com/UploadFile/DipalChoksi/DateDiff_CS_DC09132006172429PM/DateDiff_CS_DC.aspx