Error while specifying TModel & TProperty for TextBoxFor
I run over Items collection and want to build TextBox but I get the following error:

    'System.Web.Mvc.HtmlHelper<Web.Module>' does not contain a definition for 
    'TextBoxFor' and the best extension method overload
    'System.Web.Mvc.Html.InputExtenstions.TextBoxFor<TModel,TProperty>System.Web.Mvc.HtmlHelper<TModel>,System.Linq.Expressions.Expression<System.Func<TModel, TProperty>>)' has some invalid arguments

I think my anonymous function is wrong, but why?
Please help me

SocialNetworkModel class

    public class SocialNetworkModel : IViewModel
    {
        #region Properties
        public List<SocialNetworkItem> Items { get; set; }
        #endregion
        
        public SocialNetworkModel(string param)
        {
            this.Create(param);
        }
        /// <summary>
        /// DO NOT DELETE: default .ctor is used when binding posted data, from client, back to the model 
        /// </summary>
        public SocialNetworkModel() { }
        public void Create(string param)
        {
            Items = new List<SocialNetworkItem>();
            foreach(var item in Customer.Current.GetSocialNetworkList())
            {
                Items.Add(new SocialNetworkItem
                {
                    CodeName = item.CodeName,
                    Link = item.Link,
                    UserName = item.UserName,
                    Password = item.Password
                });
            }
        }
    }
    public class SocialNetworkItem
    {
        #region Properties
        [LocalizedDisplayName("CodeName", NameResourceType = typeof(Resources.Views.SocialNetwork))]
        public string CodeName { get; set; }
        [LocalizedDisplayName("Link", NameResourceType = typeof(Resources.Views.SocialNetwork))]
        public string Link { get; set; }
        [LocalizedDisplayName("UserName", NameResourceType = typeof(Resources.Views.SocialNetwork))]
        public string UserName { get; set; }
        [LocalizedDisplayName("Password", NameResourceType = typeof(Resources.Views.SocialNetwork))]
        public string Password { get; set; }
        #endregion
    }

ViewUserControl

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Module>" %>
    <% var model = Model.Model as SocialNetworkModel; %>
    
    <div id="social-network-container">
    <div id="social-network">
        <% using (Ajax.BeginForm(Model.CodeName + "FormPost", "Customer", null, new AjaxOptions() { HttpMethod = "POST" }, new { @class = "form-container" }))
           { %>
                <%model.Items.ForEach(item => { %>                
                    <%: Html.TextBoxFor<SocialNetworkItem, string>(s => item.Link)%>
                <%}); %>
           <% }%>
    </div>
</div>

Thank You


Error while specifying TModel & TProperty for TextBoxFor
===

I run over Items collection and want to build TextBox but I get the following error:

    'System.Web.Mvc.HtmlHelper<Web.Module>' does not contain a definition for 
    'TextBoxFor' and the best extension method overload
    'System.Web.Mvc.Html.InputExtenstions.TextBoxFor<TModel,TProperty>System.Web.Mvc.HtmlHelper<TModel>,System.Linq.Expressions.Expression<System.Func<TModel, TProperty>>)' has some invalid arguments

I think my anonymous function is wrong, but why?
Please help me

SocialNetworkModel class

    public class SocialNetworkModel : IViewModel
    {
        #region Properties
        public List<SocialNetworkItem> Items { get; set; }
        #endregion
        
        public SocialNetworkModel(string param)
        {
            this.Create(param);
        }
        /// <summary>
        /// DO NOT DELETE: default .ctor is used when binding posted data, from client, back to the model 
        /// </summary>
        public SocialNetworkModel() { }
        public void Create(string param)
        {
            Items = new List<SocialNetworkItem>();
            foreach(var item in Customer.Current.GetSocialNetworkList())
            {
                Items.Add(new SocialNetworkItem
                {
                    CodeName = item.CodeName,
                    Link = item.Link,
                    UserName = item.UserName,
                    Password = item.Password
                });
            }
        }
    }
    public class SocialNetworkItem
    {
        #region Properties
        [LocalizedDisplayName("CodeName", NameResourceType = typeof(Resources.Views.SocialNetwork))]
        public string CodeName { get; set; }
        [LocalizedDisplayName("Link", NameResourceType = typeof(Resources.Views.SocialNetwork))]
        public string Link { get; set; }
        [LocalizedDisplayName("UserName", NameResourceType = typeof(Resources.Views.SocialNetwork))]
        public string UserName { get; set; }
        [LocalizedDisplayName("Password", NameResourceType = typeof(Resources.Views.SocialNetwork))]
        public string Password { get; set; }
        #endregion
    }

ViewUserControl

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Module>" %>
    <% var model = Model.Model as SocialNetworkModel; %>
    
    <div id="social-network-container">
    <div id="social-network">
        <% using (Ajax.BeginForm(Model.CodeName + "FormPost", "Customer", null, new AjaxOptions() { HttpMethod = "POST" }, new { @class = "form-container" }))
           { %>
                <%model.Items.ForEach(item => { %>                
                    <%: Html.TextBoxFor<SocialNetworkItem, string>(s => item.Link)%>
                <%}); %>
           <% }%>
    </div>
</div>

Thank You

