this is my script in JQUERY step
onStepChanged: function (event, currentIndex, priorIndex) {
if (currentIndex === 3) {
$.ajax({
url: '/UserPanel/Home/GetAddressDetailsFromSession',
type: 'GET',
success: function (addressDetailsResponse) {
console.log('Address Details Received:', addressDetailsResponse.addressDetails);
if (addressDetailsResponse.success) {
$('#reviewAddress').val(addressDetailsResponse.addressDetails.address);
$('#reviewState').val(addressDetailsResponse.addressDetails.state);
$('#reviewDistrict').val(addressDetailsResponse.addressDetails.district);
$('#reviewZipCode').val(addressDetailsResponse.addressDetails.zipCode);
} else {
console.error('error: ', addressDetailsResponse.message);
alert(addressDetailsResponse.message);
}
},
});
}
}
});
and this is my view to update the view:
<h4>Your Address</h4>
<section>
<div class="row mb-3">
<div class="col-lg-12">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text">Address</span>
</div>
<input id="reviewAddress" type="text" class="form-control" disabled>
</div>
</div>
</div>
<div class="row">
<div class="col-md-5 mb-3">
<label>State</label>
<input id="reviewState" type="text" class="form-control" disabled>
</div>
<div class="col-md-5 mb-3">
<label>District</label>
<input id="reviewDistrict" type="text" class="form-control" disabled>
</div>
<div class="col-md-2 mb-3">
<label>Zip Code</label>
<input id="reviewZipCode" type="text" class="form-control" disabled>
</div>
</div>
</section>
even I Get correct data in console , the UI does not update I get correct data from controller in debug but in the view it does not update
https://localhost:44371/YourController/GetAddNewAddressForm
- It specifically says "YourController"? Not "HomeController" as implied by this?:Url.Action("GetAddNewAddressForm", "Home")
Are you specifically indicating that thedata-url
attribute on your<button>
is somehow changing? The snippets of code shown are somewhat disconnected from each other, it's not really clear what specifically is happening and it seems there is debugging information missing. Can you use your browser's debugging tools to more closely debug the functionality and see where the problem first occurs?