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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:28:50+00:00 2026-05-12T11:28:50+00:00

I’m not sure what’s wrong with the following setup. I have a View that

  • 0

I’m not sure what’s wrong with the following setup. I have a View that lists a number of records, and each has a dropdown associated with it to change a value on that record. I had it all working without AJAX, but you had to change a bunch of the dropdowns then click a Submit button. I wanted to change it so that it would save the dropdown choice immediately.

My stripped down View (of type IEnumerable(Of MyTable)):

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

<% For Each item In Model%>
<% Using Ajax.BeginForm("Update", New AjaxOptions With {.UpdateTargetId = "test"})%>
<%=Html.Hidden("id", item.id)%>
<%=item.name%>:
<%=Html.DropDownList("ActionCode", New SelectList(ViewData("actions"), "Value", "Text", item.ActionCode), New With {.onchange = "this.form.submit();"})%>
<span id="test"></span>
<br/>
<% End Using%>
<% Next%>

My Update controller:

<AcceptVerbs(HttpVerbs.Post)> _
Function Update(ByVal id As Integer, ByVal ActionCode As String) As ActionResult
    'Update would happen here
    Return Content(id & ": " & ActionCode)
End Function

What I would like to happen is for the dropdown change to trigger the Update controller, but probably not return anything – just update the database and let the user move on. What’s happening though is that a blank page is displayed with the Content value on it (i.e. “123: ABC”). It’s the correct id/code combo, so the Update seems to be firing correctly, it’s just choosing to wipe out the html.

Obviously I’m somehow not returning correctly for AJAX to work properly, but this pattern seems to match the examples I could find, so I’m not sure where I’m going wrong. Any help would be greatly appreciated.

  • 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-05-12T11:28:51+00:00Added an answer on May 12, 2026 at 11:28 am

    Are you possibly nesting form tags?

    I discovered that in this scenario, clicking the submit button actually triggers the form submission to occur in the outer form, not the inner one like you’d expect:

    <form id="outer">
      <form id="inner">
         <input type="submit" value="submit" />
      </form>
    </form>
    

    I would also recommend using a tool like the Firebug plugin for Firefox. It helps you see the ajax activity and response.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I need a function that will clean a strings' special characters. I do NOT
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.