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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:46:36+00:00 2026-06-02T17:46:36+00:00

I am completely new in ASP.NET MVC 3 and i need to create an

  • 0

I am completely new in ASP.NET MVC 3 and i need to create an application in which there is a menu that is already created and i need to add another menu item named Inbox(No. of Unread msg).

For the testing purpose i need to use timer and at some interval i increase the counter variable and bind that text into the inbox. that is after 5 sec my counter variable value is 1 then menu should be display Inbox(1), after 10 sec my counter variable value is 2 then menu should be displayed Inbox(2).

I have the same controller for all the view and i need to implement timer also. so, is there any idea to implement timer and change the menu name without affecting its controller.

currently my menu container looks similar like this.

<div id="menucontainer">
    <ul id="menu">
        <li>@Html.ActionLink("Home", "Index", "Home")</li>
         <li>@Html.ActionLink("About", "About", "Home")</li>
         <li>@Html.ActionLink("Video", "Video", "Home")</li>
         <li>@Html.ActionLink("Social", "Social", "Home")</li>
         <li>@Html.ActionLink("Photos", "Photos", "Home")</li>
         <li>@Html.ActionLink("Blog", "Blog", "Home")</li>
         <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
         <li>@Html.ActionLink("Inbox","Inbox","Home")</li>
     </ul>
 </div>
  • 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-02T17:46:37+00:00Added an answer on June 2, 2026 at 5:46 pm

    I would do something like this:

    <div id="menucontainer">
        <ul id="menu">
            <li>@Html.ActionLink("Home", "Index", "Home")</li>
             <li>@Html.ActionLink("About", "About", "Home")</li>
             <li>@Html.ActionLink("Video", "Video", "Home")</li>
             <li>@Html.ActionLink("Social", "Social", "Home")</li>
             <li>@Html.ActionLink("Photos", "Photos", "Home")</li>
             <li>@Html.ActionLink("Blog", "Blog", "Home")</li>
             <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
             <li><a href="@Url.Action("Inbox","Home")">Inbox <span class="message-count"></span></a></li>
         </ul>
     </div>
    

    and in Javascript (jQuery to make things easier)

    function checkInbox() {
        var url = '@Url.Action("GetInboxCount","Services")';
        $.get(url, { userId : @UserId }, function(data) {
            if(data != null) $(".message-count").text(data); // update count
        });
    }
    

    and in the DOM ready area, just set the interval

    (function() {
        checkInbox(); // check for the first time
        setInterval(checkInbox(), 30 * 1000); // and every 30 seconds
    });
    

    Create a controller called Services and add a method that outputs JSON, like:

    public class ServicesController : Controller
    {
        var db = yourDatabaseContext;
    
        public JsonResult GetInboxCount(int userId)
        {
            inboxCount = db.GetInboxCountByUserId(userId);
            return Json(inboxCount, JsonRequestBehavior.AllowGet);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my ASP .NET MVC 2 - application, there are several controllers, that need
I am completely new to ASP.Net MVC. I just created an MVC3 project in
Completely new to asp.net mvc... completely new to web apps so bear with me...
I have the need to expand an asp.net 2.0 web application that I recently
I have an application built in ASP.NET MVC 3 that uses SQL CE for
I have an ASP.NET MVC web application that makes REST style web service calls
I am currently starting a new ASP.NET MVC Project at work where we need
I am completely new to ASP.NET MVC, so the question might sound silly. I
I have worked with ASP.NET(C#, classic/MVC), Django(Python) and CI(php) but I am completely new
On the NerdDinner example of Professional ASP.NET MVC 1.0 there's a method to create

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.