Category : c#

public HttpResponseMessage GetObservablesCode(string form) { string responseBody = @"localstorage.setValue(‘redirectUrl’, window.location.href)"; HttpResponseMessage response = Request.CreateResponse(System.Net.HttpStatusCode.OK, responseBody, new TextPlainFormatter()); response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-javascript"); return response; } I want to execute responseBody at browser end, but it just prints as a string. Source: Ask Javascript..

Read more

This is the code that it makes it work. I’m uncertain why it doesn’t work on Opera. The code is embedded in a .master file. window.onbeforeunload = function () { var visitorId = $(‘#uid’).val(); if (!!visitorId) { var logOutUrl = "https://localhost/chatAdmin/Home/AnyOut"; $.ajax({ type: ‘Get’, data: {id:visitorId}, url: logOutUrl, success: function(result) { console.log(result); console.log("Logged Out!"); }, ..

Read more

Can someone assist me what’s wrong in my code. I’m try to convert JavaScript code to C# code public class SplitString { public static string[] Solutions(string str) { arr = []; for(var i = 0; i < str.Length; i += 2){ second = str[i+1] || ‘_’; arr.push(str[i] + second); } return arr; } } And ..

Read more

Can someone help me to convert this code from Javascript to C# Please I need someone who assist me about this. And respect my post im newby in c#. PART 1 function high(x) { const words = x.split(‘ ‘); const alphabetMap = {}; for (let i=’a’.charCodeAt(), j = 1; i <= ‘z’.charCodeAt(); i++, j++) { ..

Read more