HTML helper extensions not available in code behind.

Last post 09-17-2008 10:09 PM by levib. 4 replies.

Sort Posts:

  • HTML helper extensions not available in code behind.

    09-16-2008, 7:09 PM
    • Member
      3 point Member
    • schotime
    • Member since 01-16-2008, 6:29 AM
    • Posts 14

    If put the below text in inline tags in my view it work no problems with intellisense showing the strong typed extension method, however if i move the method to the code behind the strong typed methods don't exist.

     
    Html.ActionLink<Story>(c => c.Tag(encodedTag, 1))
     
    Does any body know why this would be the case? I would rather not have huge methods in my views and move them to the code behind. 
    Cheers.
    Adam
     
     
    Filed under:
  • Re: HTML helper extensions not available in code behind.

    09-17-2008, 7:15 PM
    • Member
      3 point Member
    • schotime
    • Member since 01-16-2008, 6:29 AM
    • Posts 14

     anyone?

  • Re: HTML helper extensions not available in code behind.

    09-17-2008, 8:42 PM
    Answer
    • Contributor
      4,545 point Contributor
    • levib
    • Member since 07-23-2007, 7:50 PM
    • Redmond, WA
    • Posts 785

    I believe the strongly-typed methods exist in the Microsoft.Web.Mvc namespace.  Make sure you have a using statement for that namespace in your code-behind.

  • Re: HTML helper extensions not available in code behind.

    09-17-2008, 10:03 PM
    • Member
      3 point Member
    • schotime
    • Member since 01-16-2008, 6:29 AM
    • Posts 14

    Cool!
  • Re: HTML helper extensions not available in code behind.

    09-17-2008, 10:09 PM
    • Contributor
      4,545 point Contributor
    • levib
    • Member since 07-23-2007, 7:50 PM
    • Redmond, WA
    • Posts 785

    The code in the System.Web.Mvc namespace is officially supported product code.  Code in the Microsoft.Web.Mvc namespace is experimental code and is unsupported.  Before we release the MVC framework, we'll modify the installer so that it installs only the officially supported binary.  I imagine the experimental binary will still be available on Codeplex or elsewhere for everybody to use.

Page 1 of 1 (5 items)