I have a script file that makes a call to JSON API, and I need to send the current login username as part of the call. I tried the following :-
$(documen
$(document).ready(function () {
var name = prompt("Please enter your packageid", "test");
var fullurl = 'http://localhost:8080/jw/web/json/workflow/process/list?j_username=kermit&hash=9449B5ABCFA9AFDA36B801351ED3DF66&loginAs=' + <%= HttpContext.Current.User.Identity.Name %> + 'packageId=' + name;
$.ajax({
type: "GET",
url: fullurl,
dataType: "JSONP",
success: function (result) {
the above code should work, on the javascript front you will not have access to HTTPContent object which is available only on the server, but putting them in a server code you should be able to access the same.
or you can have a hidden control with the value set from the server
server code would look like
uid.value = HTTPContext.Current.User.Identity.Name;