Introduction to MVC 3

This sample will teach you the basics of building an ASP.NET MVC Web application using Microsoft Visual Web Developer 2010 Express. It is part of a tutorial series written by ScottGu, Scott Hanselman and Rick Anderson.

 
 
 
 
 
(40)
65,214 times
Add To Favorites
5/25/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to Ask a Question


  • Compatible with 4.5?
    3 Posts | Last Post March 15, 2013
    • Hello, this sample is compatilble with the latest version framework 4.5?
      Tks!
    • It is compatible with 4.5, however, if you're using 4.5 you should follow one of the MVC 4 tutorials. http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4 (Visual Studio 2010) or Intro to ASP.NET MVC 4 Beta with Visual Studio 11 Beta ( http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc-4-and-visual-studio-2011/intro-to-aspnet-mvc-4 )
    • we are awaiting the examples in mvc4
  • Problems
    1 Posts | Last Post February 18, 2013
    • First problem. I downloaded the vb.net example but there was no file "movies.sdf" inside App_Data folder. 
      
      Second, I tried to create controller "MoviesController" but it showed up message: "Unable to retrive metadata for 'MvcMovie.Movie'. Using the same DbCompiledModel to create context against different types of database servers is not supported. Instead, create a separate DbCompiledModel for each type od server being used". I dont understand this suggestion. Please, help. 
  • the app can run but i cant find the movies.sdf in the app_data
    2 Posts | Last Post February 05, 2013
    • i folow your tutorial to make this app,it can run,but.....whatever it run or stop ,i cant find the movies.sdf in the app_data.
      and i cant search this movies.sdf in the windows....
      wheres the movies.sdf
      windows 8 and vs2012UTI
    • oh!ah!
      i know why!!!
      because i make the MoviesController with ues the connectionstring,
      after i use the connectionstring and then make the MoviesController,
      the probler was solved
  • Movies.sdf missing
    3 Posts | Last Post January 23, 2013
    • http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/accessing-your-model's-data-from-a-controller
      
      I'm up to this page in your tutorial where you say to check for Movies.sdf in App_Config, and it's not there. I've clicked "show all files", I've browsed to the folder in windows explorer, searched the computer, and it's nowhere.
      
      This is my connection string:
      <add name="MovieDBContext" connectionString="Data Source=|DataDirectory|Movies.sdf" providerName="System.Data.SqlServerCe.4.0"/>
      
      Everything's working fine, but I cant find and view the database. Any ideas?
    • Not, config directory, the data dir. You can verify that it's been created by looking in the App_Data folder. If you don't see the Movies.sdf file, click the Show All Files button in the Solution Explorer toolbar, click the Refresh button, and then expand the App_Data folder.
    • Movies.sdf is not in the zip file I downloaded.
  • Movies.sdf not in App_Data
    1 Posts | Last Post January 13, 2013
    • Hi,
      
      I'm on http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/accessing-your-model's-data-from-a-controller and I'm told that the Movies.sdf should be created automatically in the App_Data directory.
      
      It's not there.
      
      The app works, data is persisted.  I have commented out both the connection strings and it still works, although not after a re-boot.
      
      My connection strings are:
      
        <connectionStrings>
          <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-MvcMovie-20130112235330;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-MvcMovie-20130112235330.mdf" />
          <add name="MovieDBContext" connectionString="Data Source=|DataDirectory|Movies.sdf" providerName="System.Data.SqlServerCe.4.0" />
        </connectionStrings>
      
      Any idea what's going on?  Where is the app persisting the data?
      
      Thanks in advance,
      
      Dave
  • data
    1 Posts | Last Post September 01, 2012
    • For those of us who arent ef fans, sure would be nice if you included sql scripts to populate database tables, such as are available for adventureworks and your other sample tables.
  • Accessing your Model's Data from a Controller Problem
    5 Posts | Last Post July 13, 2012
    • Getting the following using what is in the tutorial.  The model type is invalid>  Please select an item from the list.  Alsp how can I tell that I am using .Net 4.  I have VS 2010 and Microsoft Visual Web Developer 2010 Express.  I have used the web installer for VWD 2010 and downloaded it for VS 2010 Ultimate.
      
      Thank you
      LadyDee
    • Use the links provided at the beginning of the tutorial to install VWD/SP1 or Visual Studio 2010/SP1 and the Tools Update for ASP.NET MVC 3
    • I did everything stated that needed to be install and still when I try to put Movie (MvcMovie.Models) and MovieDBContext (MvcMovie.Models) that is when I get the invalid error.
      
      Thank you
      Ladydee
    • I got the same thing.  What I did was make sure there was a space in those:
      
      Movie<space>(MvcMovie.Models) and MovieDBContext<space>(MvcMovie.Models)
    • I have the the same problem as you ladydee123 but what i did is I do the Build 
      at Debug menu first and then the Movie(MvcMove.Models) et al will now show up on the list.
      I know this kind of late reply ;-)
      But this could be helpful for others who had just recently encountered the problem.
  • Working with VS 2010 Ultimate and can't load Project file
    1 Posts | Last Post May 31, 2012
    • I download the C# version of the code sample.  However I am having trouble loading the MvcMovie.csproj file. 
      
      Error in PropertyGroup section with MvcBuildViews tag:
      The schema in msbuild/2003 has invalid child element. 
      
      Can you help?
      
      Harry
  • VB,NET errors
    2 Posts | Last Post March 20, 2012
    • Sorry I am a newbie at ASP.NET and MVC 3.  Here is a list of the errors I get when I just try to open the VB.NET download in Visual Studio 2010 Professional. Again the C# version works fine.
      
      Error	4	'SaveChanges' is not a member of 'MvcMovie.MovieDBContext'.
      Error	6	'Entry' is not a member of 'MvcMovie.MovieDBContext'.
      Error	7	'SaveChanges' is not a member of 'MvcMovie.MovieDBContext'.
      Error	9	'SaveChanges' is not a member of 'MvcMovie.MovieDBContext'.
      Error	10	'Database' is not declared. It may be inaccessible due to its protection level.
      Error	11	Type 'DbContext' is not defined.
      Error	12	Type 'DbSet' is not defined.
      Error	13	Type 'DropCreateDatabaseIfModelChanges' is not defined.
      Error	14	sub 'Seed' cannot be declared 'Overrides' because it does not override a sub in a base class.
      
      Is there something I am not doing properly before I open the VB.NET file? 
      
      I want to study how this works but I don't know why the VB.NET version is not working by following the instructions for the prerequisites listed on the site and I can't get it to work.
      
      Thanks to anyone for any help you mey be able to provide!
      
      Regards,
      
      Steve
    • Use NuGet to install the latest version of EF.
  • VB.NET download
    1 Posts | Last Post March 14, 2012
    • I have tried to open the VB.NET download on 2 different computers using Visual Studio 2010 Professional and get the same 9 errors. The C# download works fine on both systems but I need to work with VB.NET. Please let me know if there is a fix or updated download.
      
      Thanks!
1 - 10 of 18 Items