asp.net mvc - Can't get to property in razor foreach -
i'm still new mvc , razor , i'm hoping can me out something. able use following code print line (using @reply.getproperty("propertyname") when try assign variable (test) code fails. why , how can around it? need able assign , use further in other code.
@foreach (var reply in currentpage.children) { @reply.getproperty("propertyname") @{ string test = reply.getproperty("propertyname"); } }
in view
@{ string test = string.empty; } @foreach (var reply in currentpage.children) { @reply.getproperty("propertyname") test = reply.getproperty("propertyname"); }
Comments
Post a Comment