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

  • Home
  • SEARCH
  • 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 143609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:07:21+00:00 2026-05-11T08:07:21+00:00

I’ve got an issue with MVC routing(or at least I think it’s w/routing :)

  • 0

I’ve got an issue with MVC routing(or at least I think it’s w/routing 🙂 )…

Just upgraded to MVC RC1, but I’m not sure that it’s related as this is my first attempt at setting a MapRoute and corresponding RouteLink.

here’s the route:

routes.MapRoute('Test1',                 'Forecast/CurrentLineItems/{propertyID}/{forecastYear}/{forecastMonth}',                  new { controller = 'Forecast', action =   'CurrentLineItems', propertyID = '', forecastYear = '', forecastMonth = '' } ); 

here’s the RouteLink…in the view it’s wrapped in a table cell:

Html.RouteLink(Html.Encode(myProperty.Description),'Test1', new { controller = 'Forecast', action = 'CurrentLineItems', propertyID = myProperty.PropertyID.ToString(), forecastYear = '2008', forecastMonth = '10' }) 

here’s a snippet from the controller:

namespace AnApplication.Controllers   { [HandleError] [Authorize] public class ForecastController : Controller {             [AcceptVerbs(HttpVerbs.Get)]             public ActionResult CurrentLineItems(string propertyID, string forecastYear, string forecastMonth)     {        //Some code     } 

Now for the strange behavior, when I click the link specified by the RouteLink, the app enters the CurrentLineItems method and all the method arguments are correct… then it enters the CurrentLineItems method again!
with, for instance, these arguments:

propertyID = 'scripts'     forecastYear = 'jquery-1.2.6.js'   forecastMonth = ''     

It then repeats this several times as it seems to run through all the scripts on this view and the Site.Master and then the last one is the .css file for this page!
What is going on!
The Call Stack is of no help as it lists the above-mentioned CurrentLineItems method and then below that is the dreaded [External Code]

When I profile the page/view in FireFox/FireBug all I see are the jQuery calls

Here’s the html from the Site.Master re the scripts

<head runat='server'>     <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />     <title><%= Html.Encode(ViewData['Title']) %></title>     <script type='text/javascript' src='../../scripts/jquery-1.2.6.js'></script>       <script type='text/javascript' src='../../scripts/calculations.js'></script>       <script type='text/javascript' src='../../scripts/common.js'></script>         <style media='all' type='text/css'>@import '../../Content/all.css';</style>     <!--[if IE]><link rel='stylesheet' type='text/css' href='../../Content/ie.css'media='screen'/><![endif]-->           <!--<link href='../../Content/Site.css' rel='stylesheet' type='text/css' />--> </head>   

here’s a snippet from the view re the scripts

<%@ Page Language='C#' MasterPageFile='~/Views/Shared/Site.Master'AutoEventWireup='true' CodeBehind='CurrentLineItems.aspx.cs' Inherits='AnApplication.Views.Forecast.CurrentLineItems' %>  <asp:Content ID='lineItemsContent' ContentPlaceHolderID='MainContent' runat='server'> <!--<script type='text/javascript' src='../../scripts/MicrosoftAjax.debug.js'></script>--> <script type='text/javascript' src='../../scripts/lineItems.js'></script> <script type='text/javascript' src='../../Scripts/jquery.formatCurrency.js'></script> <!--<script type='text/javascript' src='../../scripts/jquery-1.2.6.min.js'></script>-->   

Note that this ActionLink works fine(It’s basically just a menu item used for testing and the three arguments are set in the code inside the controller…):

<%= Html.ActionLink('Line Items', 'CurrentLineItems', 'Forecast')%> 

Any help in solving this issue is greatly appreciated.

Thanks,
Greg

  • 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. 2026-05-11T08:07:21+00:00Added an answer on May 11, 2026 at 8:07 am

    It could be caused by the usage of relative paths to include the scripts.

    When you click on the link the URL of the new page will be something like http://[server]/Forecast/CurrentLineItems/xxx/2009/1

    Now check the html code in the browser: If the URLs are in the form of ‘../../scripts/jquery-1.2.6.js’, this will cause the browser to load it from http://[server]/Forecast/CurrentLineItems/scripts/jquery-1.2.6.js – and so your controller gets called again.

    If that is the case you could either use absolute paths (‘/scripts/jquery-1.2.6.js’) or use a path relative to the application root (‘~/scripts/jquery-1.2.6.js’) and resolve it on the server side with Page.ResolveClientUrl().

    Maybe there has been a change from Beta to RC1, so that the URLs in the head, even with runat=’server’, don’t get remapped.

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

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Splitting the label text into text and number part using… May 11, 2026 at 3:20 pm
  • added an answer While not specifically an app you can download, Developing a… May 11, 2026 at 3:20 pm
  • added an answer That regular expression tests for any amount of whitespace, followed… May 11, 2026 at 3:20 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.