Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6108175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:16:06+00:00 2026-05-23T14:16:06+00:00

I want to create a helper: @using System.Web.Mvc @using System.Web.Mvc.Ajax @using System.Web.Mvc.Html @using System.Web.Routing

  • 0

I want to create a helper:

@using System.Web.Mvc
@using System.Web.Mvc.Ajax
@using System.Web.Mvc.Html
@using System.Web.Routing
@using Proj.Extenders
@using Proj.Web.Mvc
@using Proj.Web.Mvc.Paging
@using Proj.Mvc.Helpers
@using Proj.Mvc

@helper Create(dynamic ajaxHelper, dynamic htmlHelper,
    string text,
    string targetID,
    string actionName,
    string controllerName,
    object routeValues,
    string active)
{
    <li@{ if (active == targetID) { <text> class="active"</text> } }>
        @ajaxHelper.ActionLink(htmlHelper.Resource(text).ToString(),
            actionName, controllerName, routeValues, updateTargetId: targetID)
    </li>
}

The problem is that I have extension methods on the HtmlHelper<T> where T is the type of the model. I want to use the same helper for several views, but the @model on the views will be different.

It is not finding the extension method:

'System.Web.Mvc.AjaxHelper<X>' does not contain a definition for 'ActionLink'

ActionLink method

public static MvcHtmlString ActionLink<T>(this AjaxHelper<T> ajax,
    string linkText = " ",
    string actionName = null, string controllerName = null,
    object routeValues = null, object htmlAttributes = null,
    string confirm = null,
    string httpMethod = null,
    InsertionMode insertionMode = InsertionMode.Replace,
    int loadingElementDuration = 0,
    string loadingElementId = null,
    string onBegin = null,
    string onComplete = null,
    string onFailure = null,
    string onSuccess = null,
    string updateTargetId = null,
    string url = null)
{
    var options = GetAjaxOptions(confirm, httpMethod, insertionMode, loadingElementDuration,
        loadingElementId, onBegin, onComplete, onFailure, onSuccess, updateTargetId, url);

    return ajax.ActionLink(linkText, actionName, controllerName, routeValues, options, htmlAttributes);
}

The file is located at

- Website
  - App_Code
     TabHelper.cshtml

How can I use HtmlHelper<T> and AjaxHelper<T> methods on the helper file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:16:07+00:00Added an answer on May 23, 2026 at 2:16 pm

    Inline @helper cannot be generic. You will have to use either a standard helper defined as an extension method or or simply some editor/display template or a partial view. This being said in your particular case I don’t see why your custom ActionLink must be generic. You end up calling ajax.ActionLink at the end which is not generic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a listBox: http://blog.wekeroad.com/blog/aspnet-mvc-preview-using-the-mvc-ui-helpers/ The Html.ListBox doesn't work: <div class=editor-field> <%
I am using the Html.TextBox helper to create textboxes. I want to set attributes
I want to create in ASP.NET MVC 3 a link (in Ajax) with an
I want to create a helper screen that can create a bunch of Django
I want to create a helper method that I can imagine has a signature
I want to create a hidden field and create a link in one helper
I want to create a Java application bundle for Mac without using Mac. According
I want to create a client side mail creator web page. I know the
I want to create a pagination helper. The only parameters that it needs are
I am trying to create a bunch of dynamic helper methods like these: show_admin_sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.