My layout includes a button and a dynamically filled div below it using ajax and a partial view.
Here is the code related to the button:
$(document).on('click', '.btn-release', function () {
StartReleaseVersionEdit();
ReleaseVersionEdit();
}
When the button is clicked, Ajax is used to update the data displayed in the table at the top of the page.
function StartReleaseVersionEdit() {
var url = '@Url.Action("ChangelogMavisTabel")';
url = url + '?order=0&paging=1000';
$.ajax({
type: "GET",
cache: false,
url: url,
success: function (data) {
$("div#changelog").html(data);
}
});
}
The previous code runs smoothly. However, there is a challenge when trying to modify the CSS of an element within the partial view using jQuery. Despite setting the display to none, it reverts back to its default value quickly.
function ReleaseVersionEdit(){
$('.releasebutton').css('display','inline');
// .releasebutton default display=none
}
Is there a way to resolve this issue and ensure the CSS modifications persist? Placing the jQuery inside the partial view is not an option as it should be triggered by the view's button.