Im trying to generate a new GUID every time im clicking a button wiuthoput reloading the whole view and i cant figure out what to do. This is the function
Guid.NewGuid()
by clicking a button in my Razorview. I tried it in javascript
$("#buttonclick").click(function () {
function createNewGuid() {
return new Guid.NewGuid();
}
var guid = createNewGuid();
console.log(guid);
}
and this method is just given the same guid every time i click the button. I also tried it in MVC Razor with
return "@Guid.NewGuid()"
and still gets the same result.