ITsolutionWizard
asked on
mvc inside of javascript
I tried to get mvc class inside of javascript like below. but it alerts that fixed up with javascript codes. Is it a way to use mvc inside of javascript?
@MasterHelper.Generic.Decr yptPasswor d(data[ind ex].passco de);
@MasterHelper.Generic.Decr
function UserInfo()
{
var userid = localStorage.getItem("userid");
$(document).ready(function () {
$.ajax({
url: "/Api/UserInfo",
datatype: "text",
type: "POST",
data: { 'userid': userid},
dataType: 'json',
success: function (data) {
$.each(data, function (index) {
var test = data[index].passcode;
document.getElementById("firstname").value = data[index].firstname;
document.getElementById("lastname").value = data[index].lastname;
document.getElementById("passcode").value = @MasterHelper.Generic.DecryptPassword(data[index].passcode);
document.getElementById("emailadr").value=data[index].email;
});
},
error: function (msg) { alert(msg); }
});
});
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER