Category : c#

I wrote a small razor class library which implements a custom component for CKEditor 5. Since the editor is displayed via JavaScript, I need to remove it in the DisposeAsync event from the component. Here is my interop implementation: export function setup(id, dotNetReference) { var newEditor = null; ClassicEditor .create(document.querySelector(‘#ckeditor-‘ + id), { toolbar: { ..

Read more

I use the .net application to design my web. I import the file below: //html file like: <script src="~/js/login/login.js" type="module"></script> //code login.js below: import reponsitoryfactory from "../../service/factory/reponsitoryfactory.js"; const authreponsitory = reponsitoryfactory.get("auth"); export function login() { alert(‘fasfs’); var data = { "username": $(‘#txt-username’).val(), "password": $(‘#txt-password’).val() }; authreponsitory.login(data).then(function (response) { if (response.data.success) { alert("success"); } }); }; ..

Read more

I have implemented the following code in wwwroot – index.html: "use strict"; (() => { const modified_inputs = new Set; const defaultValue = "defaultValue"; // store default values addEventListener("beforeinput", (evt) => { const target = evt.target; if (!(defaultValue in target || defaultValue in target.dataset)) { target.dataset[defaultValue] = ("" + (target.value || target.textContent)).trim(); } }); // ..

Read more

Here I have blazor server app, I have two <select> cascading dropdown where on change of <select class="form-control classId select2" @bind="chapterModel.SchClassId"> dropdown I want list of subject based on selected <select class="form-control classId select2" @bind="chapterModel.SchClassId"> dropdown in another dropdown<select class="form-control subject select2" @bind="chapterModel.subjectId">. Since I am using select2 dropdown I have Js onchangefunction for dropdown ..

Read more

I have written a code in c#, javascript, using client library SignalR to refresh a page in database value change. My code is <form asp-action="Start" method="post" class="form-stacked"> <button type="submit" id="startPractice" class="button-primary">Start Practice</button> </form> <script src="~/js/ignalr/dist/browser/signalr.js"></script> <script src="~/js/chat.js"></script> My API method is which is called while clicking start practice is public async Task<IActionResult> Index(long sessionId) { ..

Read more

We are working on MS Teams Application in which we need to do authentication with third party identity server. Currently, when we enter the third-party domain in "Valid Domain" list it works as expected in both MS Teams Desktop and MS Teams Web application. Please find our sample code as follow, microsoftTeams.initialize(() => { microsoftTeams.authentication.authenticate({ ..

Read more

How to convert this backend code to javascript? my inputs are hex data without (0x) in one sentence like this one ("c01fgh8751") is equivalent of 0xc0 0x1f 0xgh 0x87 0x51 Right data: input1 = c0a80ae7534d415254434c4f5544aaaa0F03FEFFFE0031015505000001 crc = 91D8 input2 = c0a80ae7534d415254434c4f5544aaaa0F03FEFFFE0031015505640001 crc = D673 https://gist.github.com/chitchcock/5112270 this code does not help C code from docs This ..

Read more