CSS Solved Papers
Physics Chemistry

Engineering :: MVC

  Loading DB Table Fields dynamically in Razor
@foreach (var property in ViewData.ModelMetadata.Properties) {


this code runs only in CRUD files...and for index page where we have
@model IEnumerable it works as
     var metadata = ModelMetadata.FromLambdaExpression(m => m.ToArray()[0], ViewData);
    var properties = metadata.Properties;
@foreach (var property in properties) {


Write your comments here:
Name *:     Email:

© 2012-2024 by GeekMCQ™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy | Referals

Contact us: