Category : c#

I have an asp.net project where I’ve inserted a gridview of data from my mssql database. The headers of each column are clickable but onclick do not sort the data. <div style ="overflow:auto"> <asp:GridView ID="GridView1" runat="server" AllowSorting="True" OnSorting="GridView1_Sorting" CellPadding="4" OnRowDataBound="GridView1_RowDataBound" HorizontalAlign="Center" Width="800px" ForeColor="Black" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellSpacing="2"> <FooterStyle BackColor="#CCCCCC" /> <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" ..

Read more

I am working on a program (C# with .Net Core 3.1) that needs to be extended with javascript. These javascripts need to be able to send web requests. Since I like the implementation of Jint (https://github.com/sebastienros/jint) very much, my choice fell on this Javascript implementation. Unfortunately, the XMLHttpRequest object is not supported out of the ..

Read more

I am working on a Blazor server project and have this button in my component <button type="button" class="btn btn-primary" @onclick="@GetUserInput">Add Name</button> Here is the code I have that the click event is calling protected async void GetUserInput() { var result = await JsRuntime.InvokeAsync<string>("getName"); } function getName() { var retVal = prompt("Enter Name : ", "name ..

Read more

I have a button that executes code behind in c#. The code behind gets some information from the database and writes a fairly long piece of JavaScript that it then registers and runs on the client. The code behind looks something like this: protected void Button1_Click(object sender, EventArgs e) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); ..

Read more

ASP.NET Web Form Project. My C# function is using a try/catch for possible errors and if I get an error, I want to pass the string value of the error to my Javascript function that I’m calling inside of my CreatRoleBtn_Click () function catch block. C# Function: protected void CreateRoleBtn_Click(object sender, EventArgs e) { try ..

Read more

I’m using Blazor as a web application and im trying to get the value of converted base64 file to my C# app. Currently I’m having trouble with getting the previous scanned file to my C# app and not the current one that I’ve scanned. function getPDFFile() { const element = document.getElementById("report"); var file = html2pdf().set({ ..

Read more