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 8581657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:06:21+00:00 2026-06-11T21:06:21+00:00

I have created a custom razor helper in my MVC4 Web application that I

  • 0

I have created a custom razor helper in my MVC4 Web application that I need to be usable in all of my views.

In all of my view pages, I can’t seem to use my custom helper. VS2012 doesn’t just see it.

How Can I resolve this please ?

EDIT: It actually works when I run the page, it’s just VS that doesn’t see it.

Here is my helper which is located in Helpers.cshtml within my AppCode folder.

@helper TextBox(string title, string id, string placeholder, bool required){    
<ul>
    <li>
        <label for="@id">@title</label>
    </li>
    <li>
        <input type="text" name="this" class="@if (@required) {<text>required</text>}" minlength="2" id="@id" placeholder="@placeholder" />
    </li>
</ul>
}
  • 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-06-11T21:06:22+00:00Added an answer on June 11, 2026 at 9:06 pm

    If it is razor helper(using @helper syntax), you should define it in view placed within \App_Code

    We can accomplish this by saving our @helper methods within
    .cshtml/.vbhtml files that are placed within a \App_Code directory
    that you create at the root of a project. For example, below I
    created a “ScottGu.cshtml” file within the \App_Code folder, and
    defined two separate helper methods within the file (you can have any
    number of helper methods within each file):

    And if it is more traditional html helper, you should reference it, by adding record to namespaces element of <system.web.webPages.razor> defined in ~\Views\Web.Config. If you want to use it only in singe view, you could add @using directive on top of view.

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

Sidebar

Related Questions

Have created a custom navigation menu in wordpress that has some pages and some
I have created Custom Dialog for my application. While i run that application in
I have created custom cell in which there are n number of image views.
I have created a custom method that will return unique items, together with the
I have created a custom view with a XIB file and are loading the
I have created a custom attribute that I am using on my class MyClass
I have created a custom class for my dates and need move dates forward
I have created a custom AppleScript that works, and placed it in the folder:
I have created a custom validation rule (uniqueUserName). The problem I'm having is that
I have created Custom Annotation with following: -(MKAnnotationView*)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { MKPinAnnotationView *view =

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.