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

The Archive Base Latest Questions

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

I’m very new to the AJAX and Javascript world and I’m trying to implement

  • 0

I’m very new to the AJAX and Javascript world and I’m trying to implement Scott Hanselman’s example of form submission to update part of a page. I have copied his example almost word-for-word and I can’t seem to get it to work. When I click the submit button the controller action is called successfully but the result is rendered in the browser as a new page, instead of updating just the span that I specified in the Ajax form.

Here is my view code:

<asp:Content ID='indexHead' ContentPlaceHolderID='head' runat='server'>     <title>Home Page</title> </asp:Content>  <asp:Content ID='indexContent' ContentPlaceHolderID='MainContent' runat='server'>      <% using (Ajax.BeginForm('TestAction', new AjaxOptions { UpdateTargetId = 'target' }))        { %>          <%= Html.TextBox('TextBox')%>         <input type='submit' value='Submit' />         <span id='target' />      <% } %>  </asp:Content> 

And my controller action:

    public string TestAction(string TextBox)     {         return TextBox;     } 

And I have included the following lines in the master page

<script src='../../Scripts/MicrosoftMvcAjax.debug.js'type='text/javascript'></script>   <script src='../../Scripts/MicrosoftMvcAjax.js' type='text/javascript'></script>  <script src='../../Scripts/MicrosoftAjax.js' type='text/javascript'></script>  

But all it seems to do is call the action and render the result as a new page, instead of updating the target span. Here are some small screenshots to illustrate what’s happening.

Screenshot 1 http://martindoms.com/scr1.JPG

Screenshot 2 http://martindoms.com/scr2.JPG

Any ideas?

  • 1 1 Answer
  • 1 View
  • 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-11T15:37:27+00:00Added an answer on May 11, 2026 at 3:37 pm

    You have the javascript include in your master page in the wrong order. Reorder so that MicrosoftAjax.js is included first of the three and it will work.

    <script src='../../Scripts/MicrosoftAjax.js' type='text/javascript'></script> <script src='../../Scripts/MicrosoftMvcAjax.js' type='text/javascript'></script> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.