ASP.NET MVC 4 Sample (Magazine website)

A small example that used an ASP.NET MVC 4 in a Visual studio 2012 for implemented a Magazine website. (Up coming version, I will integrate with a new Single Page Application template - Durandaljs, Knockoutjs, Jquery, Twitter Bootstrap...) - for an admin page

C# (17.5 MB)
 
 
 
 
 
(28)
47,432 times
Add To Favorites
5/3/2013
E-mail Twitter del.icio.us Digg Facebook
Sign in to Ask a Question


  • how to study this code
    1 Posts | Last Post May 30, 2013
    • Hi , I'm new to mvc . i downloaded your project but  i don't know how to trace it . i mean if i want to statr a new one base on your code , what would be the steps of implementing that ? 
      also , when i want to register new member , i get the error of websecurity.createmember() about display name and other stuff..
      I tried to change table and make DisplayName unnecessary but that error still exists. 
      can you at first tell me what are the steps ? 
      and then how to fix this registration problem ?
      
      i appriciate your help ;)
      
  • How to add new articles?
    1 Posts | Last Post May 27, 2013
    • Will this feature be included?
  • Problem when i refresh the Home page
    1 Posts | Last Post May 25, 2013
    • Hi,
      
      Is it normal if i make 2 F5 when i'm loading the home page, i got
      
      "There is already an open DataReader associated with this Command which must be closed first."
      
      Do you know how i can fix this issue ?
      
      Thanks
  • build error
    1 Posts | Last Post May 22, 2013
    • i just downloaded it and opened it in visual studio 2012 and made a built, got errors regarding automapper and some dll, not being found. 
      
      Sorry this is equal to one star. 
  • Object reference not set to an instance of an object.
    2 Posts | Last Post May 06, 2013
    •  @Html.ActionLink(Model.FirstItem.ItemContent.Title, "Details", "Home", new {id=Model.FirstItem.Id}, null)
      
      is this an indication that's there is no connection to the database?
    • @hazz Actually, there is no technical for detect the database null or no connection to database here. This is only a simple sample. We need to develop that feature in advantage sample if needed.
  • upload: Server Error in '/' Application.
    1 Posts | Last Post April 23, 2013
    • When I add new article, an error i cannot solve is:
      
      Server Error in '/' Application.
      'System.Web.HttpPostedFileWrapper' does not contain a definition for 'CreateImagePathFromStream'
      Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
      
      Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Web.HttpPostedFileWrapper' does not contain a definition for 'CreateImagePathFromStream'
      
      Source Error:
      
      
      Line 99:             if (vm.SmallImage != null)
      Line 100:            {
      Line 101:                smallImagePath = vm.SmallImage.CreateImagePathFromStream(_itemStorage);
      Line 102:            }
      Line 103:
      
      
      Source File: e:\ASP.NET MVC 4 Sample (Magazine website)\C#\Web\Areas\Admin\Controllers\ItemController.cs    Line: 101
      
      Stack Trace:
      
      
      [RuntimeBinderException: 'System.Web.HttpPostedFileWrapper' does not contain a definition for 'CreateImagePathFromStream']
         CallSite.Target(Closure , CallSite , Object , IMediaItemStorage ) +248
         CIK.News.Web.Areas.Admin.Controllers.ItemController.CreateOrUpdateItem(Object vm, Boolean isNew) in e:\ASP.NET MVC 4 Sample (Magazine website)\C#\Web\Areas\Admin\Controllers\ItemController.cs:101
         CIK.News.Web.Areas.Admin.Controllers.ItemController.Create(ItemCreatingViewModel viewModel) in e:\ASP.NET MVC 4 Sample (Magazine website)\C#\Web\Areas\Admin\Controllers\ItemController.cs:48
         lambda_method(Closure , ControllerBase , Object[] ) +127
         System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +261
         System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
      ......
      
      thangchung and everyone help me please
  • How to complete steps 2 and 3
    2 Posts | Last Post April 23, 2013
    • Sorry, I am new to MVC and Microsoft Visual studio and connecting to or creating databases in general.
      
      I don't understand how to complete the first two steps
      
      Step 2: Run a database script, the script can be find at C#\1.DatabaseScripts\3.NewsDbScript.sql
      
      Step 3: Host CIK.News.Web to IIS host
      
      When I try to run the database script I get a connect to server screen and don't know what to do from there.
      
      Any more detailed help on these two steps would be appreciated.  Thanks
    • You can open your SQL server management studio tool to run that script, make sure you have SQL server installed in your machine. Then simple thing you can do is open IIS and create one application and browse to your location that you put this source code. Hope this help. 
  • Completing beginner steps
    1 Posts | Last Post April 07, 2013
    • I am a beginner and having trouble with these steps.
      Step 2: Run a database script, the script can be find at C#\1.DatabaseScripts\3.NewsDbScript.sql
      
      Step 3: Host CIK.News.Web to IIS host
      
      Where do I run the database script?
      Also it seems as though some .dll are missing from my solution.
  • Image file upload issue
    1 Posts | Last Post March 29, 2013
    • I downloaded your version testing it find that an error i cannot solve is 
      
      'System.Web.HttpPostedFileWrapper' does not contain a definition for 'CreateImagePathFromStream'
      
      when i look at the CreateImagePathFromStream in HttpPostedFileExtension the function with 2 params and just got one param when you call.
      
      <code1>
       public static string CreateImagePathFromStream(this HttpPostedFileBase postedFile, IMediaItemStorage imageStorage)
      
      <code2>
      
      if (vm.SmallImage != null)
                  {
                      smallImagePath = vm.SmallImage.CreateImagePathFromStream(_itemStorage);                          
                  }
      not sure you uploaded the latest full version or not, can you please let me know.
      
      Anyway, thank you for your example.
      
  • This Repository Pattern implementation is yours?
    2 Posts | Last Post November 26, 2012
    • Hi I like very much how did you implement the repository pattern, with this extensions and the functions in the GenericRepository.
      
      I get lost when you construct the ContextBuilder, ContextStorage, etc.
      
      So is there a blog, or a book where THIS implementation is described? if it's yours, great... why you don't spent/invest some time to describe it.
      
      Thanks again.
      
    • @JLSF As mention on description of this example, I introduced the DAL from another guys, actually he is my former teamleader. You can reference this at http://huyrua.wordpress.com/2010/07/13/entity-framework-4-poco-repository-and-specification-pattern/
1 - 10 of 15 Items