Skip to content
Loading
ASP.NET MVC QUERY  
  •               
  • }  
  •  
    if issue is not clear than which part you have issue like HTMl part or in c# ?
     
    Thanks 
    0
  • hello sandy
     i have two table first table display all user record.
    suppose
    ============ 
    Rinki 
    sandy
    ============
     and second table difine list of products
     
    suppose
    ===========
    computer
     
    headphone
    =============
     
     when i will update my profile my name will display and all product display after my name
    suppose
    ========================
    rinki
    checkbox     computer
    checkbox     headphone
    ========================
     in this page i have to select product. After selecting product when i again update my profile all product with select product will display.
    0
  • Sandy
    Hi Rinki,
    You have to create one viewmodel which contain List of user .
     
    Each user object contains list of product.
    You can fetch users from database from any of method like edmx or ADO.Net. 
     
    Use below code in Rajor view for display
     
    1. foreach (var user in Model.users)  
    2.            {  
    3.         user.DisplayName  
    4.          foreach (var product in user.Product)  
    5.          {  
    6.                class="checkbox">  
    7.                    
    8.                        "checkbox"  
    9.                               name="SelectedFruits"  
    10.                               value="@product.Value" /> @product.Text  
    11.                          
    12.                    
      
  •            }  
  •         }  
  •  
    Let me know If your problem not resolve.
     
    Thanks 
    0