asp.net mvc - Previous ajax request changes the post URL for next form submit -


i making jquery ajax request in asp.net mvc page:

$.ajax({             type: "post",             url: "/home/go",             data: dataobj,             success: function (data) {                 // update html here                 }             }         }); 

this call within page, has form , other elements submit other url (lets "/home/do"). after ajax call returns, if click on other element form still submits url1 instead of url2

note tried adding "return false" statement click event handler ajax call made. did not help

the ajax call made within jquery dialog:

$('#mydialog').dialog({ buttons:             [                 {                     text: 'next',                     click: function () { handlenext(); return false; }                 }             ],             title: 'dialog-title'         });    function handlenext()  {      $.ajax({                 type: "post",                 url: "/home/go",                 data: dataobj,                 success: function (data) {                     // update html here                     }                 }             });   return false; } 

anybody faced similar issue? solutions?

return false in click handler mandatory ajax requests. web browser visit url otherwise. in other words: ajax request made first , regular request.

no urls can automagically replaced other urls. either in javascript code, or in action/view.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -