Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Suma Maria Mathews 23 posts 164 karma points
    Mar 17, 2017 @ 07:19
    Suma Maria Mathews
    0

    'System.Web.Mvc.HtmlHelper<Umbraco.Web.Models.RenderModel>' does not contain a definition for 'DropDownList'

    Hi,

    While I am using a dropdownlist in my view, I am getting the error

    'System.Web.Mvc.HtmlHelper

    Any help appreciated!

    Thanks & Regards,

    Suma

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Mar 17, 2017 @ 10:40
    Frans de Jong
    0

    Can you show us a code example of what you are trying to do?

  • Suma Maria Mathews 23 posts 164 karma points
    Mar 20, 2017 @ 06:17
    Suma Maria Mathews
    0

    Hi Frans,

    enter image description here

    intellisense is not working as shown in the image eventhough functionalities are working perfectly.

    Thanks,

    Suma

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Mar 20, 2017 @ 11:55
    Michael Latouche
    0

    Hi Suma,

    I see that all your html attributes definitions contain an identifier "@class", could you try naming it "class" like this:

    .... new  {id = "ddlclass", class = "dropdown-bopx-full"}
    

    Hope this helps.

    Cheers,

    Michael.

  • Suma Maria Mathews 23 posts 164 karma points
    Mar 20, 2017 @ 13:37
    Suma Maria Mathews
    0

    Hi Michael,

    Thanks for responding.

    Without identifier, it is throwing error. Since 'class' is a reserved word, '@' is necessary it seems.

    Thanks,

    Suma

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Mar 23, 2017 @ 09:42
    Frans de Jong
    0

    Does it help if you place @using System.Web.Mvc in your view?

    Does it work when using:

    @Html.DropDownListFor(x => x.Session,  listItems, new {id="ddlSession", @class="dropdown-box-full"})
    

    And you are right. The @ before class needs to be there.

Please Sign in or register to post replies

Write your reply to:

Draft