Search Results

Search found 2 results on 1 pages for 'engil'.

Page 1/1 | 1 

  • ASP.NET MVC Posted date field comes in as 1/1/0001

    - by engil
    Just started working with .NET and MVC(1). I'm having a problem wherein in my add action the entered date for some reason ends up as 1/1/0001 instead of what is entered thus causing a date overflow. In my model, this field ("Added") is is of type datetime and does not allow nulls. In my controller I have: public ActionResult Add() { Instance instance = new Instance() { Added = DateTime.Now, Active = true }; return View(instance); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Add(Instance instance) { if (ModelState.IsValid) { try { System.Diagnostics.Trace.Write("test"); instanceRepository.Add(instance); instanceRepository.Save(); return RedirectToAction("Details", new { id = instance.InstanceID }); } catch { ModelState.AddRuleViolations(instance.GetRuleViolations()); } } return View(instance); } And in my view I have: <div class="editor-label"> <%= Html.LabelFor(model => model.Added) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(model => model.Added,String.Format("{0:g}",Model.Added))%> <%= Html.ValidationMessageFor(model => model.Added) %> When I first go to Instances/Add the default value is set correctly, however as soon as I submit the date turns into 1/1/0001 (from my understanding this indicates that it was either null or in an unrecognizable format) When I debug and palce a watch on Request.Form I see the date coming in encoded ie Request.Form {Added=4%2f9%2f2010+8%3a24%3a39+AM} - is this an issue? I know its probably not enough information to make a conlusive determination on why this is failing, but if someone could provide some good debugging tips on how to determine where the submitted date is getting munged I'd really appreciate it.

    Read the article

  • Newbie - eclipse workflow (PHP development)

    - by engil
    Hi all - this is a bit of a newbie question but hoping I can get some guidance. I've been playing around with Eclipse for a couple months yet I'm still not completely comfortable with my setup and it seems like every time I install it to a new system I end up with different results. What I'm hoping to achieve is (I think) fairly standard. In my environment I'd like SVN (currently using Subclipse), FTP support (currently using Aptana plugin), debugging (going to use XDebug) and all the usual bells and whistles of development (code completion, refactoring, etc.) My biggest current issue is how to set up my environment to support both a 'development' and 'production' server. Optimally I would be able to work directly against the dev server (Eclipse on my Vista desktop against the VM Ubuntu dev server) and then push to production server (shared hosting). I'd prefer to work directly against the dev server (with no local project files, just using the Connections provided by Aptana) but I'm guessing this won't allow for code-completoin or all the other bells and whistles provided for development. Any thoughts? Kind of an open ended question, but maybe this could be an opportunity for some of you with a great deal of experience using Eclipse to describe your setups so people like me can get some insight into good ways to get set up.

    Read the article

1