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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:08:18+00:00 2026-06-18T00:08:18+00:00

Additional: Download my project with my failed attempt at converting to AttributeRouting. The project

  • 0

Additional:

Download my project with my failed attempt at converting to AttributeRouting.
The project will run correctly when the message on the home page changes between “No new email.” and “You have mail!”. In its current errored state that message does not change.
Errors in the javascript console will show.
Navigating directly to /Checkemail with the browser results in 404 error.

Original Post:

This is a question about AttributeRouting (using latest v3.4.1).

I am trying to hook a GET[""] onto the following code.

[GET("")] I get a 404 – resource not found.
[GET("CheckEmail")] I get a 405 – Method not allowed.

I am trying to convert this project to AttributeRouting: source code. The checkemail action is where I am failing.

The method is an asynchronous method as part of an “ajax long polling” technique.

I have the following with my dismal attempts commented:

public class CheckEmailController : AsyncController
    {
        //
        // GET: /CheckEmail/

        //tried [GET("")]
        //tried [GET("CheckEmail")]
        public void IndexAsync()
        {
            AsyncManager.OutstandingOperations.Increment();
            MyAsyncEmailChecker.CheckForEmailAsync(hasEmail =>
            {
                AsyncManager.Parameters["hasEmail"] = hasEmail;
                AsyncManager.OutstandingOperations.Decrement();
            });
        }

        private class IndexResponse
        {
            public bool d { get; set; }
        }

        public JsonResult IndexCompleted(bool hasEmail)
        {
            return this.Json(new IndexResponse() { d = hasEmail });
        }

    }

Global.asax.cs – as for all my AR projects

public class MvcApplication : System.Web.HttpApplication
{
    public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
        filters.Add(new HandleErrorAttribute());
    }

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

    }

    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();

        RegisterGlobalFilters(GlobalFilters.Filters);
        RegisterRoutes(RouteTable.Routes);
    }
}

thank you

  • 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-18T00:08:19+00:00Added an answer on June 18, 2026 at 12:08 am

    If you are on ASP.NET MVC 4 and .NET 4.5 then you should just use the async keyword and Tasks. This should fix your issue with routing and reduce the complexity in your controllers. Here is the a link to whitepaper by microsoft.

    http://www.asp.net/mvc/tutorials/mvc-4/using-asynchronous-methods-in-aspnet-mvc-4

    but to sum it up your code would change to this.

    public class CheckEmailController : AsyncController
    {
        //
        // GET: /CheckEmail/
        [GET("CheckEmail")]
        public async Task<ActionResult> Index()
        {
          return View( new IndexReponse {
            d = await MyAsyncEmailChecker.CheckForEmailAsync() 
          });
        }
    
        public class IndexResponse
        {
            public bool d { get; set; }
        }
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Additional question: Total received data length is now 89973. But converting it into a
I am working on a project in NLP requiring me to download quite a
I am trying to implement a new feature in our Delpi project that will
in my referenced library of my project i have: hibernate-validator-4.1.0.Final.jar but when i run
I run an open source project that normally distributes our code in a universal
Additional questions regarding SilentGhost's initial answer to a problem I'm having parsing Twitter RSS
Additional thanks extend to Daniel Newby for answering my memory usage question (and Martin
How can I add additional, custom information to my objective-c methods and properties? I
How can I impose additional behavior when in the edit mode of a table
Is there some additional logic performed by Associate() operation? I want to programmatically copy

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.