Search Results

Search found 1 results on 1 pages for 'peteshack'.

Page 1/1 | 1 

  • form data posted using linq-to-sql not showing until I refresh the page

    - by PeteShack
    I have an asp.net mvc app with a form. When you submit the form, it adds records to the sql database with linq-to-sql. After adding the records, the controller displays the form again, and should show those new values on the form. But, when it displays the form, the values are blank, until you refresh the page. While tracing through the code, I can see the records being added to the database when they are submitted, but the view doesnt display them, unless I refresh. The view is not the problem, it just displays the view model, which is missing the new records immediately after the post. I know this is kind of vague, but wasnt sure what parts of code to include here. Could this have something to do with data context life cycle? Basically, there is a data context created when the form is posted, then a different data context is created in the method that displays the form. Any suggestions on what might be causing this?

    Read the article

1