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

Related Questions

I've been trying to figure this out over several questions here on SO, finding
I just cannot figure this out, it looks really simple but I'm relatively new
After loosing much sleep I still cannot figure this out: The code below (its
I have tried so many things, cannot figure this out, I am using this
I cannot figure out why I get this error during check-in. I checked in
I cannot figure out how to convert this code from C# to VB.net. It
I have this code and cannot figure out how it could be simplified via
I'm getting this error when I submit my form and cannot figure out why
I have this little problem, that I cannot figure out which arguments to pass
I'm quite new to this, but i cannot figure out the problem. In twitter

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.