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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:45:37+00:00 2026-05-27T12:45:37+00:00

Using MVC Razor I have a very simple test. The logger writes messages to

  • 0

Using MVC Razor
I have a very simple test. The “logger” writes messages to a log file

TestController.cs

public ActionResult Index()
{
  logger.Trace("Test Index Called");
  return View();
}

Index.cshtml

<html>
<head><title>Testing</title></head>
<body><h3>This is a test</h3></body>
</html>

global.asax.cs

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

When I run the code, the log file shows this:

2011-12-15 10:16:09.4475: Test Index Called

2011-12-15 10:16:09.4475: Test Index Called

Notice that the timestamp for both calls are at exactly the same time? I’ve eliminated the issue where people have said that empty src attributes on a image tag and/or javascript functions not returning.

I’ve made this as simple as I possibly can – but the index action is being called twice in rapid succession.

Help?

  • 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-27T12:45:38+00:00Added an answer on May 27, 2026 at 12:45 pm

    Are you 100% sure that it’s not the logger that writes two entries for each call? (For instance if you have configured two filters for the same logging target)

    It’s highly unlikely that ASP.NET can process the same action two times at the exact same millisecond.

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

Sidebar

Related Questions

Using MVC-3, Razor: -- MyController -- public ActionResult Index(String message) // where message =
I am using EF4 + MVC 3 with Razor. I have the following ActionResult
I'm playing around with Razor + MVC 3 and have a really simple scenario...
I have a problem in my application I am using MVC 3 with razor
I am using ASP.NET MVC 3 with the Razor view engine . I have
I have something like in MVC (I am using MVC c# using razor): @Html.ActionLink(Edit,
How can i directly access a .cshtml file in ASP.NET MVC using razor view
I'm using ASP.NET MVC 3 (Razor) and have created a Controller named Controllers -
Everyone, I'm using MVC 3 (Razor). I have the following problem: I have some
In my ASP.net MVC App (using Razor views) I have a ProductDetails view. This

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.