Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. mvc razor complex object ( where to find help )

mvc razor complex object ( where to find help )

Scheduled Pinned Locked Moved ASP.NET
asp-netjavascriptwpfwcfarchitecture
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cechode
    wrote on last edited by
    #1

    I have been a developer for many years non of which have been on web front end :( So i decieded to tackle one of the items on my "wanna know" list. this time it's mvc3 i am attempting to create simple crud for this objet( below ) but am suck on the "MyItems" list. I am looking for the create / edit to be created with one operation for both the MyClass properties + ( adding the line items for MyItems ). so far i've attemnpted to create a partial view which uses jquery to clone nodes to create a single item for MyItems and include that partial view in my Create view. however i am not getting the objet binding correct for when i submit the save, MyItems is always empty. Any pointers and links to tutorials etc on the matter are greatly appreciated Advice and solutions welcome as well :)

    public class MyClass
    {
    public MyClass()
    {
    MyItems = new List<MyItem>();
    }

    \[Required\]
    public string Name { get; set; }
    public int Age { get; set; }
    
    public List<MyItem> MyItems { get; set; }
    
    public class MyItem
    {
        public string Lable { get; set; }
        public string Value { get; set; }
    }
    

    }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups