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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:40:58+00:00 2026-05-14T08:40:58+00:00

I gave this in my site.master <li><%= Html.ActionLink(Material, Index, Material)%></li> But my link doesnt

  • 0

I gave this in my site.master

<li><%= Html.ActionLink("Material", "Index", "Material")%></li>

But my link doesnt seem to get my material controller Index method… I have this in my global asax file,

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default",                                              
                "{controller}/{action}/{id}",                           
                new { controller = "Home", action = "Index", id = "" }  
             );

            routes.MapRoute(
                "Default",                                              
                "{controller}/{action}/{id}",                            
                new { controller = "Material", action = "Index", id = "" }  
            );

        }

My controller:

public class MaterialController : Controller
{
    //
    // GET: /Material/
    Material material = new Material();
    public ActionResult Index()
    {
        var materials = material.FindAllMaterials();
        return View();
    }
 }

What am i doing wrong…. When i click the link i get
The resource cannot be found.
error.. Any suggestion…

  • 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-14T08:40:58+00:00Added an answer on May 14, 2026 at 8:40 am

    Dump question -> make sure you’ve saved/compiled. What hints that u didn’t do this, is that u have two routes with the same name (aka. Default). Compiler should error.

    Secondly, try to manually goto that resource. Ie, goto http://localhost:/materials/index and see if that works. Of course, replace the localhost with whatever is the dev url of your site. If that works.. continue.

    Thirdly, hover the mouse over the html anchor (aka. the a href) and see what is displayed in the browsers ‘status’ bar. It should list the resource url which that anchor will redirect you to. Does it say ‘http://localhost:/materials/index’ ??

    basically, the code looks ok for the HTML.ActionLink .. but there’s a few other possible things that have happened to screw this up.

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

Sidebar

Related Questions

I had this problem some time ago and I gave up but lately it
First of all I did gave a look at this one. But I didn't
I have a Django site running with PSQL but when my friend gave the
I'm pretty sure that this is the right site for this question, but feel
I made a banner ad and the site gave me this code to work
This is my first time posting a question on this site, but certainly not
In Jquery Template website they gave this example.( http://api.jquery.com/jQuery.template/ ) <script> var movies =
A friend gave me this code snippet in Clojure (defn sum [coll acc] (if
I desined a button in Blend, which gave me this xaml in after the
This StackOverflow question gave me food for thought on what is a good structure

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.