Try our conversational search powered by Generative AI!

Html.PropertyFor properties to render items on one row in the view


I am trying to get my blocks in my ContentAre on one row. Now they end up on one row each.

@Html.PropertyFor(x => x.Advice, new { ChildrenCssClass = "block" })

Advice is my ContentArea that holds my blocks. I have tried different properties to PropertyFor without any luck. 

Does anyone of you have any idea of how I can make this work?

Apr 06, 2016 20:15

Can you post your style rules for .row and .block? You probably want to set the class row in the propety as well:

@Html.PropertyFor(x => x.Advice, new { CssClass = "row" ChildrenCssClass = "block" })

This will render:

<div class="row">
    <div class="block">
        Your block 1 content
    <div class="block">
        Your block 2 content
Apr 07, 2016 0:14

I fixed the problem by sending values to my block through:

@Html.PropertyFor(x => x.Advice, new { y = @Model.CurrentPage.Y})
Apr 07, 2016 11:00
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.