Questions tagged [.net]

Please refrain from using this tag for inquiries related to .NET Core; kindly utilize the [.net-core] tag instead. The .NET framework has been specifically developed as a software framework primarily catering to the Microsoft Windows operating system. It encompasses an implementation of the Base Class Library, Common Language Runtime (often referred to as CLR), Common Type System (commonly known as CTS), and Dynamic Language Runtime. Embracing numerous programming languages such as C#, VB.NET, F#, and C++/CLI, it offers comprehensive support.

Error encountered when creating a new project using ASP.NET Core (.NET 5) and Angular 11

When I start a new ASP.NET Core Web API + Angular project in Visual Studio by using: dotnet new angular, it sets up a .NET 5 project with an Angular 8.2 project in the ClientApp folder. After hitting F5, everything runs smoothly. However, I want to work ...

Changing a Unique JSON Structure into a VB.NET Object

I have a JSON object that is structured as follows. { "Errors":{ "err1":[ //* Array of err1 objects ], "err2":[ //* Array of err2 objects ] } } This object is used to report errors identified in a request to a PHP page. My goal i ...

Having trouble deploying NodeJS app on Azure platform

After successfully installing the SDK, I proceeded to try out the Hello World example. However, when I reached the Publish-AzureService command, it encountered an error: PS C:\code\node\tasklist\WebRole1> Publish-AzureService -name ...

Effective Management of Unwanted Postbacks in VB.NET with Ajax UpdatePanel

TASK: Develop a webpage that presents a loading animation upon button click, which disappears once processing is finished. CHALLENGE: I have set up a page with an Ajax UpdatePanel that initially functions correctly by showing a loading screen on button cl ...

Leveraging the power of VB.net to extract data from JSON code

Hello, I need to extract the values of 21, black jack, and tongits including their scores from the following JSON code: { "id": 1, "status": "PARTIAL", "scores": [ { "scoreCard": { "21": 0, "black jack": 0 ...

Transform JSON empty arrays into XML using Json.NET (Newtonsoft)

Considering the given JSON data: string json = @" { ""Identifier"": ""MyID"", ""Data"": [] }"; If I change it to XML using: XDocument xDocument = JsonConvert.DeserializeXNod ...

What's the best way to transform createHmac function from Node.js to C#?

Here's a snippet of code in Node.js: const crypto = require('crypto') const token = crypto.createHmac('sha1', 'value'+'secretValue').update('value').digest('hex'); I am trying to convert t ...

Tips for accessing the names of subdirectories and files on a website

If we have the URL, is it possible to access the names of the files within the parent directory? Similar to how we can do in DOS by using the command "DIR" to view the list of files inside a folder. For example, if we have a URL like , I am curious to kno ...

Retrieve the class name from a CSS stylesheet

How can I extract all the CSS class names from a CSS file? This is what my CSS file looks like: p.juicy{ margin-left:40px; } p.csBody{ text-align:justify; } p.csCode{ font-family:"Lucida Console", Monaco, monospace; background-color:sil ...

Stop modal from closing in the presence of an error

My approach involves using a generic method where, upon adding a food item, a modal window with a form opens for the user to input their details. However, since backend validation for duplicate items can only be retrieved after the API call completes. I w ...

Transform IAlert into an Observer role

While using Selenium, I have encountered some websites with random popup messages that disrupt the testing process. I think implementing an Observer pattern using IAlert to catch and handle these alerts could be a solution. The idea is to accept the alert ...

I'm experiencing issues with Ajax.Utility.RegisterTypeForAjax not properly registering the ajax type on my device

I'm experiencing a strange issue with Ajax.Utility.RegisterTypeForAjax. It seems to be working fine for all other members of my team, but I keep getting this error: 0x800a1391 - JavaScript runtime error: 'AjaxClass' is undefined To troubl ...

Tips on effectively deserializing JSON elements with identical element collections in C#

I am facing a challenge with deserializing a collection of elements in JSON that contains nested collections of the same elements in C#. How can I achieve this? So far, I have attempted to solve this by creating a C# class for the elements and defining pr ...

Obtaining Data from CRM 2011 with the Power of jQuery and JavaScript

Currently, I am facing an issue while attempting to retrieve data from CRM 2011 using jQuery. Despite my efforts, I am unable to successfully fetch the desired data. Below is the code that I have been working on: function GetConfigurations() { var oDataP ...

How to Serialise Objects in Json.net to a Custom JSON Format Excluding Property Names

I am currently working on developing a unique implementation for the spellchecker in tinymce. In order to achieve this, I require a JSON object of specific format to be returned from my ashx page. { "words": { "misspelled1": ["suggestion1", "sugges ...

Submitting an intricate item to a WCF REST API using JQuery

Currently, I am attempting to send a complex object to my WCF REST service. Utilizing this method seems to be the most straightforward way to upload a Stream type object along with other parameters to an endpoint simultaneously. Service: [OperationContra ...

Serializing a JSON object to a C# class

Currently, I am tackling the task of deserializing a Json Object into a class in .NET Visual Studio 2015 on Windows 7. public class1 { [JsonProperty(TypeNameHandling = TypeNameHandling.Objects)] public Class1 data1; public Class2 data2; } pub ...

Extracting a JSON object from a serialized value

Below is a simple C# class object that I want to convert into a JSON string: public class SampleObject { public SampleObject() { Name = "Hello"; State = 7; } public string Name { get; set; } public int State { get; set ...

I want to know how I can observe modifications to the DOM while running JavaScript using phantomjs and Selenium.WebDriver

I am attempting to extract the links from a specific website using C#, phantomjs, and Selenium. The site features a login popup form that is triggered by a login link. Although the code executes correctly and displays the popup in the saved image, the DOM ...

Remove data from a database using Ajax in ASP.NET MVC without utilizing DataTables

I'm encountering a slight issue with my code. I am attempting to delete a row from the database without using DataTables in ASP.NET MVC, but it seems to be not working as expected. I have displayed all items from the database on a page within div elem ...

Unveiling the Secrets: Reading .Net Web Service in PHP

After successfully reading the WSDL from SoapClient, I attempted to pass a value to a web method and read the results: $client = new SoapClient("restaurant.asmx?wsdl"); $param = array('search_keywords'=>$search_text); $result = $client->__soapCall ...

Angular Inner Class

As a newcomer to Angular, I have a question about creating nested classes in Angular similar to the .NET class structure. public class BaseResponse<T> { public T Data { get; set; } public int StatusCo ...

Tips for transferring TimeZone Name from Angular to .NET API

Currently, the API I am working with accepts TimeZone names (such as America/Denver) as a string. In my Angular UI application, I automatically pass the browser timeZoneName to the API. However, when the API receives the string America/Denver, it interpret ...

Navigating to Protected Mobile Platform

I am experiencing an issue with accessing a .NET website with SSL on my Blackberry device. When I try to view the site, I receive the message "HTTP ERROR 403 FORBIDDEN - You're not authorized to view this page. Please try loading a different page". Th ...

Pair objects that possess a specific attribute

I have a HTML snippet that I want to modify by adding the CSS class HideEdit to hide specific columns. <th class="rgHeader" style="text-align: left;" scope="col" _events="[object Object]" control="[object Object]" UniqueName="Edit"> This particular ...

Update the div and table without waiting for a specific time interval when an event happens

Currently, I have a table within a div that includes both editing and deleting functionality for records. After deleting a record, I want the table to be automatically updated with fresh data without having to reload the page. Can someone please provide me ...

Transforming FullCalendar (jquery) into asp.net (ashx)

///////////// Expert //////////////// $(document).ready(function() { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); $('#calendar').fullCalendar({ ...

Is there a way to successfully press a button on a website?

While testing, I start by navigating in the constructor webBrowser1.ScriptErrorsSuppressed = true; webBrowser1.Navigate("http://www.tapuz.co.il/forums/forumpage/393"); webBrowser1.DocumentCompleted += webBrowser1_DocumentCompleted; Next, in the DocumentC ...

C# backend and React frontend struggling with MVC routing implementation

Exploring MVC with .Net for the first time. Here is my C# controller implementation: namespace TFL.Controllers { [Route("api/[controller]")] public class TubeApiController : Controller { [HttpGet("[action]")] public async Task ...

Query to retrieve specific JSON elements

Here is a snippet of JSON data: {"response":[2939, {"mid":6581,"date":1345018696,"out":0,"uid":84175314,"read_state":1,"title":" ... ","body":"Text1"}, {"mid":6578,"date":1344984256,"out":0,"uid":32438192,"read_state":1,"title":" ... ","body":"Text2"} ]} ...

Encountered an unexpected character in C# Json.net during value parsing: [

public class JSON_Explore_Root { public string browse_content { get; set; } public List<JSON_Browse_Content> Content { get; set; } } public class JSON_Browse_Content { public string link { get; set; } public string image { get; set; ...

Develop an integration of NextJS with .Net Core framework

Looking to develop a solution that integrates NextJS on the frontend and .NET6 on the backend within one unified setup for hosting on IIS10. While exploring Visual Studio 2022, I noticed a React template but encountered issues when trying to transition to ...

Guide on accessing an anonymous object from BindingContext

Looking to implement custom model binding by creating an implementation for IModelBinder in a .Net Core 2.1 API application. Model class - [ModelBinder(BinderType = typeof(PersonBinder))] public class Person { public name {get;set;} publ ...

JavaScript effectively divides multiple child dropdowns with the main dropdown, thanks to Bootstrap innovation

I have implemented a jQuery function to dynamically change multiple child dropdowns based on the selected value of the main dropdown. For reference, you can view the image here. However, I encountered an issue when applying the Bootstrap styles "form-con ...

A web service that retrieves data in the form of a JSON object and returns

I need assistance with creating a webservice in .NET Framework 4.0 that will generate and return data in json format. Here is the code I have for the WebMethod: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string GetLobMonth(st ...

How can I write the code to enable dragging the button for navigating to the next page?

<a draggable="true" class="user" id="leonardo" ondragstart="dragUser(this, event)" aria-selected="undefined"> IPD</a> If I want the button to navigate to the next page when dragged, what code should I write? ...

How do you handle an object of a specific type that can only be determined at runtime?

Here's a query I have: We're working on an ASP.NET web application that is designed to cater to multiple clients. The crucial aspect is the app's need to transform specific JSON strings into .NET object of type <T> so that it can be passed to a WCF ...

Is there a way to align all child elements to the right side inside a multi-select checkbox dropdown list using Angular?

I am seeking assistance with the following scenarios: I have a multiselect dropdownlist using the ng-multiselect-dropdown control in Angular. The parent and child items are bound using the code below in the HTML file: <ng-multiselect-dropdown name=&qu ...

Best practices for managing errors and exceptions in frontend React and backend .NET/C#

My React frontend communicates with a .NET/C# backend. When the user clicks a button, an integer is sent to the backend. If the number is positive, everything runs smoothly. However, if it's less than 0, an exception occurs. I know how to handle res ...

Issue encountered on IIS 7.x server during deployment with HTTPS

Currently, I am running an Angular + .Net 4.5 fullStack application on IIS V7.5 with Windows Server. To conduct additional tests, I am using multiple instances of the same site with different versions of the application deployed on the same host. Each inst ...

Is there a method to communicate with controls via a web interface?

I've been exploring the possibility of interacting with ASP controls from within a webmethod. My initial thought was that I could achieve this by identifying the page where the webmethod was called from and then locating and updating controls on that page. ...

Exploring binary large object files with AngularJS

I am in a state of confusion and would appreciate any suggestions to help me navigate this situation. Here are some key points: Tasks at hand: downloading and uploading files, with the ability for the client to view JPG files directly in the browser. Th ...

Selenium C# is experiencing difficulties in running properly on localhost

I am attempting to scrape a website using Selenium and FireFox. While the Python code works fine, I encounter an issue in C# where I receive the error message: 'OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:53355/' ...

Send a request to the XML file through the web

I am currently working with a vendor who has provided me with information that I need to code in order to retrieve data from them. The task at hand is sending a POST request to a URL that ends with .xml. The documentation specifies that the request shoul ...

Main page featuring User Control employing AutoCompleteExtender

Purpose of Application: My website project consists of a master page, a sub master page, and various content pages. I have developed user controls to present information on the main master page. These controls are registered directly on the main master p ...

Troubleshooting issues with jQuery getJson() in an ASP.NET MVC environment

I'm trying to utilize jQuery to make a simple call to my MVC controller. I've successfully tested the server side, as the controller correctly received the ajax call and returned the requested information. However, on the client side, the data is not getti ...

Encountering CORS issue while trying to connect frontend with microservice API in a production environment

I am encountering CORS issues in my production environment with a microservice-based application that functions smoothly in development. Whenever my frontend attempts to send a request to the ApiGateway, I encounter the following error: Access to XMLHttpRe ...

Tips for converting Anonymous-typed Objects to XML format

Is it possible to convert a dynamically created object into an XML string? var foobar = new { foo = "bar" }; string xml = ConvertToXMLString(foobar); //the generated XML should look similar to: //<foo>bar</foo> I have explored using both XML ...

Decoding JSON with various Tokens in C#

When I query the Klout API, I receive a response that contains the following fields: Name Score ScoreDeltas Day Change Week Change Month Change After creating classes in .NET and populating objects with JSON responses, everything functions properly. Ho ...

Guide to deserializing JSON in C# with a specific type header and a variable type body

My JSON string contains a fixed type header and a variable body as shown below: [DataContract] public class ServiceResponseHeader { [DataMember] public string ErrorCode { get; set; } [DataMember] public string Message { get; set; } } [Da ...

What is the most efficient method for transferring rows from an SQL Database to JavaScript?

Recently, I've been exploring the dynamic features of HTML5 IndexedDB controlled by Javascript and how to sync it with an SQL Server database for offline access. The challenge I'm facing is determining the most efficient method to transfer data from an SQ ...

Incorrect input

Let's consider this scenario: We have a workspace website similar to Google Drive. (Remember that) There is a Delete .icon on my files list to delete a file. When I request the delete file WebMethod using Ajax, I also want to retrieve the updated file ...

Creating SQL server tables from JSON automatically in C#

Users are sending me JSON Form Data. Here is an example of the data: { "Name":"Mike", "Age":25, "Gender":"Male", "Skills":{ ".Net":true, "Mule":"" } } I need to save this data in a table on SQL Server, but there isn't alrea ...

What steps can be taken to confirm that the library or package I am responsible for maintaining remains compatible with previous versions?

As the caretaker of a library or package distributed through various package managers like NuGet, Maven, or NPM, I have unfortunately encountered instances where updates to my package inadvertently disrupted backwards compatibility. For instance, there wa ...

Polling database from various browser tabs

Working on a .NET/angular application that regularly checks the SQL Server database for updates, with the user able to customize the polling interval starting from 10 seconds (as per business requirements). The issue arises when each new tab opened by a ...

Unable to invoke a function in TypeScript from a Kendo template within the Kendo TreeList component

In my TypeScript file for class A, I am encountering an issue with the Kendo TreeList code. I am trying to call a function from the Kendo template. export class A{ drillDownDataSource: any; constructor() { this.GetStatutoryIncomeGrid ...

"Have you ever wondered about the magic that unfolds when we utilize AJAX

I'm confused about the concept of AJAX. When we use AJAX, why doesn't the page get refreshed every time? Is this related to the page_load method or something else? ...

Storing a pair of distinct data fields in a c# Array Json from a Class

Greetings! I have been working on a code snippet where I define all the necessary classes to create a JSON string for a put request. My goal is to include both the AttributeColor and AttributeSize fields in the attributes array so that the JSON output look ...

What happens if a web service is not triggered when the return type is modified in the signature?

After creating an asp.net web service, I integrated it using jquery ajax. The specific jquery ajax method used is as follows: $.ajax( { type: "POST", url: "../../Search/Address.aspx/Search2", contentType: "application/jso ...

Using `ITimeouts.ImplicitlyWait(TimeSpan)` in Selenium is now considered outdated and deprecated

In my C# project, I have been using the ImplicitlyWait method like so: driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20)); Initially, everything worked fine. However, after updating to selenium-dotnet-3.1.0, I encountered the following e ...

Unleash the power of unescaping Unicode strings with System.Text.Json in dotnet

When using JsonSerializer.Serialize(obj), it produces an escaped string; however, I am in need of the unescaped version. Here is an example: using System; using System.Text.Json; public class Program { public static void Main() { var a = n ...

A new update is available for the UpdatePanel and ModalPopup Extender

I have structured my form as follows: <asp:Panel runat="server" Id="xyz"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> 'Gridview featuring edit and delete options ...

Issue with retrieving the current location while the map is being dragged

How can I retrieve the current latitude and longitude coordinates when the map is dragged? I've tried using the following code: google.maps.event.addListener(map, 'drag', function(event) { addMarker(event.latLng.lat(), event.la ...

Developing a Web service in .NET 4.0 for fetching JSON data on Android devices

Currently, I am without any code at hand. My task involves building a webservice that can retrieve data from a database in JSON format to be used in an Android application. I'm feeling a bit lost on how to get started with this project. Any guidance or a ...

What is the best way to convert an object into JSON format in a desktop C# application while including the class name of the object as the root element?

Imagine having an object like this: var person = new Person() { name = "Jane" }; When attempting to send this object as Json to a web server using the following code: HttpResponseMessage result = await client.PostAsJsonAsync(url, person); this is ...

Error in retrieving Ajax URL with incorrect .net format

Recently delving into C# tutorials to expand my skills, I encountered an issue while attempting to make an ajax call to the server using localhost. Despite my efforts, it seems like I am missing something crucial. It could be related to my folder structur ...

A Comparison of Python MVC Framework, .NET, and Rails in Terms of Middleware

Exploring a fresh project and in search of the ideal technology for maintaining a Middleware Layer. This layer is aimed to provide REST and SOAP Webservices for multiple devices (mobile and web). The two main requirements are speed and ease of setup with ...

Convert JSON Array to List via Deserialization

I attempted the suggested solution, but I am still encountering issues when trying to print the list. Below is the JSON data: var result = [ { "id": 1409636 }, { "id": 1499272 }, { "id": 1409587 }, { ...

Is it worth converting XML to JSON for better performance levels?

Currently, I am storing my settings using the Visual Studio integrated Settings-Management-System, which utilizes XML. However, in a recent article on fastJSON (http://www.codeproject.com/Articles/159450/fastJSON), I learned that "the fastest XML is ~50x ...

Retrieving information from the controller within the error callback of a jQuery AJAX request in ASP.NET MVC

I've been working with a jQuery ajax script that looks like this: $.ajax({ type: "POST", url: "Main/receive", // the method we are calling contentType: "application/json; charset=utf-8", data: JSON.strin ...

Filling a HTML div with data through PageMethods and AJAX

My issue is quite unique. Despite checking numerous examples before reaching out here, I am facing a peculiar problem. I have a div element in my ASPX file and I am using AJAX to send a POST request to populate it. <script> function send(input ...

Learn the process of converting C# code to Kotlin with the incorporation of a Json library

Hello, I am new to Kotlin and apologize for my poor English. I am trying to convert the code snippet below to Kotlin. However, I am having trouble finding the equivalent of [JsonExtensiondata] in Kotlin. public class ProofAttribute { [JsonProperty(&q ...

The functionality of SelectByText (partial) in C# Selenium WebDriver bindings appears to be malfunctioning

I am currently facing an issue using the Selenium WebDriver Extensions in C# to select a value from a select list by matching partial text. Despite trying different approaches, I can't seem to get it to work as expected. Could this be a mistake on my end o ...

Transform legitimate JSON into a Task<string>

Currently, I am working on mocking ReadAsStringAsync on the first line to be used in a unit test that will result in a Task where the string represents the JSON provided below: var jsonString = await response.Content.ReadAsStringAsync(); // converting it ...

Unable to submit form upon clicking radio button in .NET Core

Trying to submit a form by clicking on a radio button. The JQuery code used for submitting the form: Form: @for (var item = 0; item < Model.Count(); item++) { <form id="myform" action="xx" controller="xxx" method="post"> ...