Thursday, August 11, 2011

Where does Razor fit in ASP.NET?


C# Razor Syntax Quick Reference

http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx

http://www.asp.net/webmatrix/tutorials/2-introduction-to-asp-net-web-programming-using-the-razor-syntax


ViewBag, ViewData, or TempData in ASP.NET MVC


  • ViewData
    • ViewData is a dictionary object that you put data into, which then becomes available to the view. ViewData is a derivative of the ViewDataDictionary class, so you can access by the familiar "key/value" syntax.
  • ViewBag
    • The ViewBag object is a wrapper around the ViewData object that allows you to create dynamic properties for the ViewBag.


  • TempData

    TempData is meant to be a very short-lived instance, and you should only use it during the current and the subsequent requests only! Since TempData works this way, you need to know for sure what the next request will be, and redirecting to another view is the only time you can guarantee this. Therefore, the only scenario where using TempData will reliably work is when you are redirecting



    http://rachelappel.com/when-to-use-viewbag-viewdata-or-tempdata-in-asp.net-mvc-3-applications

    Validate uploaded image content in ASP.NET

    http://dotnetexpertguide.blogspot.com/2011/05/validate-uploaded-image-content-in.html