Pages

Thursday, September 27, 2012

How to solve "String was not recognized as a valid DateTime." when parse a date?

By ParseExact
var date = System.DateTime.ParseExact(StartDate, "MM/dd/yyyy",null);

How to check if user is logged in ASP.NET MVC

            if (!Request.IsAuthenticated)
            {
                return RedirectToAction("LogOn","Account");
            }