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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:39:41+00:00 2026-05-11T13:39:41+00:00

I cannot figure out why this Ajax request is not firing correctly. For simplicity’s

  • 0

I cannot figure out why this Ajax request is not firing correctly. For simplicity’s sake I’ve been trying to implement Ajax request using this tutorial. However I cannot get my controller to recognize the request as being so. I’ve tried placing the Ajax.ActionLink within the div to be updated (outside of it here).

Using the Response.Write to place the Datetime, the one within the Div does get updated, whilst the one outside of the target div does not (as expected). I’m not all too familiar with how the MS Ajax library works, but on the surface it seems to be updating the right section of the page, but my controller won’t recognize the request type, and therefore outputs the incorrect information.

...     <script src='../../Scripts/MicrosoftAjax.js' type='text/javascript'></script>     <script src='../../Scripts/MicrosoftMvcAjax.js' type='text/javascript'></script>     <script src='../../Scripts/jquery-1.2.6.min.js' type='text/javascript'></script>  </asp:Content> <asp:Content ID='Content2' ContentPlaceHolderID='MainContent' runat='server'>     <div class='chart' id='divChart'>         <% Html.RenderPartial('GraphView', Model); %>         <br />         <% Response.Write(DateTime.Now); %>         <br />     </div>     <%= Ajax.ActionLink('no parameters', 'MyWorkouts', new AjaxOptions{ UpdateTargetId = 'divChart'}) %>     <%= Ajax.ActionLink('id parameter', 'MyWorkouts', new {chtype=1},new AjaxOptions { UpdateTargetId = 'divChart', OnBegin = 'beginContactList', OnSuccess = 'successContactList', OnFailure = 'failureContactList' })%>     <%= Ajax.ActionLink('all parameters', 'MyWorkouts', new {chtype=2, range=ViewData['daterangevalue']},new AjaxOptions { UpdateTargetId = 'divChart', OnBegin = 'beginContactList', OnSuccess = 'successContactList', OnFailure = 'failureContactList' })%>     <br />     <% Response.Write(DateTime.Now); %>     <h2> ... 

And then my ActionResult looks like so…

[AcceptVerbs(HttpVerbs.Get)]         public ActionResult MyWorkouts(int? chtype, int? range) {             int dateRange = 3;               // do some stuff here - left out for readability              if (Request.IsAjaxRequest()) {                 if (range != null) {                     dateRange = (int)range;                 }              }             //do some other stuff...              if (Request.IsAjaxRequest()) {                 return PartialView('GraphView', workouts);             } else {                 return View(workouts);             }         } 

(Everything is pretty much default as this is just a test page to implement it once I have it figured out). As a result, I keep getting the full view inside of the targeted 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. 2026-05-11T13:39:41+00:00Added an answer on May 11, 2026 at 1:39 pm

    It looks like you may be using an older version of MVC framework?

    If so I recommend updating to the release version and ensuring that you are using the newest jquery and mvc scripts… There were some changes specifically in how the Request.IsAjaxRequest() method works that may be related to your problem.

    Also, if there is a RedirectToAction call involved in there you might want to read about a similar problem here.

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

Sidebar

Ask A Question

Stats

  • Questions 285k
  • Answers 286k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No alloc/init or new so it will be autoreleased when… May 13, 2026 at 4:49 pm
  • Editorial Team
    Editorial Team added an answer EDIT: Those three different elements all have different rendering rules.… May 13, 2026 at 4:49 pm
  • Editorial Team
    Editorial Team added an answer Other browsers can be more forgiving of errors in your… May 13, 2026 at 4:49 pm

Related Questions

I cannot figure out why this Ajax request is not firing correctly. For simplicity's
How can I validate that my ASPNET AJAX installation is correct. I have Visual
Every attempt I had at making a button default failed, until someone on here
I've searching forever trying to figure out why IE will not save the current
From: https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript The same origin policy prevents a document or script loaded from one

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.