I am working with universal apps in Visual Studio 2015 since a few days and I have absolutely no clue how to access a c# method in a class since there is no "WebMethod"-Attribute.
<script type="text/javascript">
function getWindowsDeviceUUID() {
//$.ui.popup({
// title: "methodcall",
// message: "trying to call methode"
//}
// );
$.ajax({
type: 'POST',
url: 'MainPage.xaml.cs/GetDeviceUUID',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (uuid) {
$.ui.popup({
title: "success",
message: "called method"
}
);
return uuid;
}
});
};
</script>
I already tried it with ajax but the "GetDeviceUUID"-method isn't called. However the getWindowsDeviceUUID is.
Some Additional Information: I already have multiple JS & HTML files I have to use in this app. I open the HTML-Sites via a WebView control.
Kind regards