Skip to content
Loading
Passing information from view to different models
  • I am trying to understand why a list of address when each user has a unique address?
    Thank you for helping
    0
  • Joginder Banger
    Hi Schleid Alex,
     
    you need the One user class and List
    for example like that.
     
    1. public Class User  
    2. {  
    3. public string UserName{get;set;}  
    4. public String Somethingvalue  {get;set;}  
    5.   
    6. public List
       LstAddress{get;set;}  
    7.   
    8. }  
    9.   
    10. public class Address  
    11. {  
    12.   
    13. public LocalAddress {get;set;}  
    14. public PermanentAddress  {get;set;}  
    15.   
    16.   
    17. }  
    I hope u understand, what's going in above class.
     
    Thanks
    Joginder Singh 
    0
  • I found this article my only problem is I am not dealing with a list of user but just one user and his address information, how can I adapt the code in this article
     
    https://www.aspsnippets.com/Articles/Pass-Send-Multiple-Models-to-one-View-in-ASPNet-MVC-Razor.aspx
    0
  • Laxmidhar, I don't understand.
    0
  • Laxmidhar Sahoo
    hi
    You are in the write direction 
    0