Вот мой код:
`$(document).ready(function () {
Код: Выделить всё
document.querySelector('.k-spreadsheet-sheets-bar-add').style.display = 'none';
const urlParams = new URLSearchParams(window.location.search);
const id = urlParams.get('analysisId');
var sessionPassword = sessionStorage.getItem('analysisPassword').toString();
$.ajax({
url: "@Url.Action("Create", "Create")",
data: { id: id, sessionPassword: sessionPassword },
contentType: "application/json",
type: "GET",
success: function (response) {
if (response.success) {
alert("Daten wurden erfolgreich geladen!");
}
else if (response.passwordIncorrect) {
alert("Kein gültiges Passwort!");
window.location.href = 'http://localhost:55844/Index/Index'
}
},
error: function () {
alert("Error loading data.");
}
});
Я хочу отправить «пароль сеанса» на свой контроллер:
Код: Выделить всё
public ActionResult Create(int analysisId, string password)Я добавил ".toString" в sessionPassword, я думал, что это проблема, но это не решило. п>
Подробнее здесь: https://stackoverflow.com/questions/784 ... javascript
Мобильная версия