Questions tagged [asp.net]

ASP.NET, created by Microsoft, is an innovative framework for developing web applications. It enables programmers to effortlessly construct dynamic websites, web services, and cutting-edge web applications. To ensure accurate categorization, it is recommended to employ corresponding project type tags such as [asp.net-mvc], [asp.net-webforms], or [asp.net-web-api] alongside this tag. However, refrain from employing this particular tag when addressing inquiries related to ASP.NET Core; instead, make use of the [asp.net-core] tag.

How can I effectively address issues with jqGrid's sorting and paging functionality?

After making changes to the server-side code, it now looks like this: int nm = objects.ToList().Count; if (objects.ToList().Count > 0) return new PagedList(objects, nm, 1, 25, null); else return null; The JSON data has been updated as follows ...

Is there any way to remove the two default aspNetHidden Divs in asp.net web forms?

After creating an empty webform page in asp.net, the generated code looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Threetier.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org ...

"Successfully made an Ajax request to the web handler, however, the response did not

Within my ASP.NET project, I have a Generic handler with the following code: public void ProcessRequest ( HttpContext ctx ) { try { ctx.Response.ContentType = "text/json"; var jsonData = new StreamReader(ctx.Request.InputStrea ...

Unable to process jquery AJAX request

Hello, I've been attempting to make a simple ajax call to a method in my code behind. Despite keeping it straightforward for testing purposes, I keep encountering errors. It seems like a basic mistake, but I'm at a loss on how to proceed. The process appea ...

Utilizing Asp.Net in C#, Incorporate GridView within a jQuery Dialog

I am attempting to dynamically display a DataGridView using a function. Let's dive into the code: HtmlGenericControl div = new HtmlGenericControl("div"); div.ID = Guid.NewGuid().ToString(); GridView grid = new GridView(); grid.Attributes.Add("runat", "se ...

Repeater embedding a Div

I'm currently attempting to access a hidden div within my repeater by clicking a button that is also located within the repeater. The hidden div is set to display as none, and the button contains a jQuery script triggered on OnClientClick. Here's an examp ...

What is the process for obtaining the updated file name of a file that has been saved using ajax AsyncFile

When utilizing the asyncfileupload ajax plugin from the ajax toolkit to save a file, I am running into an issue where the filename needs to be changed to prevent duplicates. To inform the user of the new filename after upload, I have implemented the follo ...

Troubles with AutoCompleteExtender within the EditItemTemplate of a DetailsView

I am encountering a strange issue with two AutoCompleteExtender controls on my webpage. One is in the default Insert mode of my DetailsView, while the other is in Edit mode. Additionally, there is another DetailsView which is only visible when a Checkbox i ...

Is `console.log()` considered a native function in JavaScript?

Currently, I am utilizing AngularJS for my project. The project only includes the angular.min.js file without any additional references to other JavaScript files. The code snippet responsible for sending requests to the server is as shown below: var app = ...

Automatically refreshing the page when the back button is clicked

Within my ASP.NET application, I have two pages - Page A and Page B. When a user clicks on a link on Page A, they are redirected to Page B. However, if the user then clicks the browser's back button while on Page B, I need to force a refresh of Page A ...

ASP.NET Dynamic Slideshow with Horizontal Reel Scrolling for Stunning

I'm curious if there is anyone who can guide me on creating a fascinating horizontal reel scroll slideshow using asp.net, similar to the one showcased in this mesmerizing link! Check out this Live Demo for a captivating horizontal slide show designed for ...

What methods can be used to include optional settings in a custom JsonDotNetResult?

Presented here is an alternative JsonResult, known as the class below, which offers a more advanced JSON serializer compared to the default option for MVC Web Apps (unnecessary details are excluded): public class JsonDotNetResult : JsonResult { public ...

Tips on Retrieving JsonResult

I'm encountering some difficulty when trying to write this AJAX function. My goal is to retrieve a JsonResult, which appears to be the most logical solution. However, all of the examples I've come across utilize Json() in order to convert the re ...

Troubleshooting positioning issues with jQuery tooltip within an update panel on a Content

I am having difficulty with the Jquery tooltip feature. In my ASP.Net project, I have a Gridview inside a content page and I want to display a tooltip when the user hovers over a label using jQuery. I am using the jquery tool plugin to show this informat ...

What is the best way to incorporate JavaScript multiple times on a single webpage?

<script type="text/javascript"> $(function() { var newYear = document.getElementById('HF'); alert('hehe' + newYear); $('#countdown1').countdown({ until: newYear, format: 'DHMS', layout: '<div id="timer"& ...

The value of the comment box with the ID $(CommentBoxId) is not being captured

When a user enters data in the comment box and clicks the corresponding submit button, I am successfully passing id, CompanyId, WorkId, and CommentBoxId to the code behind to update the record. However, I am encountering an issue as I also want to pass the ...

What could be causing the issue with the 100% height and 100% width not functioning properly on my ASPX page?

The CSS and HTML code work perfectly in an isolated test environment: body, html { height: 100%; min-height:600px; min-width:800px; overflow:hidden; margin:0;padding:0; } html {overflow:auto;} .fill {height:100%; width:100%; backgro ...

Utilizing the '<' or '>' operator in combination with an if statement within a Repeater component

Is it possible to use an if statement in a repeater like this? <%#Eval("FN").ToString().Count > 0 ? "SB" : "" %> When I try to implement this, I receive an error 73 indicating that the > operator cannot be used. How can I adjust it so that i ...

The Jquery ajax function fails to execute after upgrading the framework version from 3.5 to 4.0

After testing with alert, I am facing an issue where the ajax call is not working in my aspx.cs file when switching from .NET framework 3.5 to 4.0. The ajax function being used is: function GetCustomers(pageIndex) { $.ajax({ t ...

Combining Multiple Partial Views with Their Respective View Models in ASP.NET MVC: A Step-by-Step Guide

I am working on a view named Register where I include other views using @Html.Partial("ViewName"). I am curious about how to call other ViewModels from the partial views within this main view. While I know that each ViewModel with its fields can be declar ...

Invoke OnSelectedIndexChanged from GridView prior to any other function execution

In my scenario, there are two GridViews available. The first GridView allows the user to select a row, based on which a corresponding list will be displayed according to the selected GridView ID. First Grid: https://i.stack.imgur.com/d0OKq.png Second Gri ...

Activate Button upon Textbox/Combobox/RadDatePicker Modification through JavaScript

On my ASP.NET form, I have various input elements including textboxes, dropdowns, date pickers, and update buttons. My goal is to enable the update button whenever a user makes a change in any of these fields. To achieve this, I applied a specific CSS cla ...

What is the process of dynamically altering the content inside a td element?

Is there a way to dynamically change the content of a td based on the state of a checkbox? If the checkbox is unchecked, the td should remain plain, but if checked, I want the text to have a specific style: b style="font-family:Tahoma;font-size:8pt;color: ...

Utilizing JQuery in a Subdirectory with the MasterPage located in the Main Directory

Currently, I am facing an issue while trying to utilize the jquery library in ASP.NET within a subfolder named "samples" with a master page located in the root directory. The problem arises when the references to the jquery scripts are placed in the head t ...

Div blur event for editing content

Utilizing a content editable div as an input control has presented some challenges for me. Unlike a textarea or input element, the div does not send information to the server automatically. To work around this issue, I have implemented a solution where I u ...

Updating the CSS link href in ASP.NET using code behind

I'm struggling with changing the CSS href in the code-behind of my .ASPX page. I've tried various methods but haven't found a solution that works as intended. HTML Markup: <link id="linkCSS" runat="server" href='/css/1.css' re ...

"Repeating SignalR Messages: Issue of Duplication when Stopping and Restarting

Whenever I stop and start the connection, messages sent to the client by the hub are duplicated. If I follow this sequence: $.connection.hub.stop() $.connection.hub.start() {...} and a message is sent from the server hub to the client, it is initially re ...

Images for the background of the table header and sorting icons

Currently, I am utilizing jquery.tablesorter for table sorting functionality. However, I have a desire to apply a pattern to my table headers using a background-image. Unfortunately, when I do so, the .headerSortUp and .headerSortDown classes on the sorted ...

Align Text Center inside a Magical H1 Heading Tag

I'm having a bit of trouble with something that should be simple. I want to center the text inside my h1 tag on a wizard, and I've added this CSS to my stylesheet.css: .h1textalign { text-align:center; } Here's how I'm trying to apply the class: <asp ...

The Context.Principal is returning as null when making a Web API request

I have developed a web application using ASP.NET (.NET Framework 4.8) and ASP.NET WEB API 2, with SQL SERVER 2016 as the database backend. The app is integrated with Azure AD using OpenIDConnect (authorization code flow). For this specific scenario, I hav ...

Initiating a Page with Dynamic Modal Window according to Backend Exigencies

Dear experts, can you help me with a problem? I want to implement a modal window on an vb.aspx page if a specific condition from the codebehind query is true. How can I achieve this? Thank you! ...

Interested in incorporating dynamic calendar entries in ASP C#?

Here is the code snippet I utilized: <script> var count = 1; var limitValue = 3; function addNewInput(sectionName) { if (count == limitValue) { alert("You have reached the limit of adding " + count + " inputs"); ...

Obtain sub-elements from deeply nested JSON structures

I have a JSON string with the following structure: "total": 5, "filtered": 5, "items": [ { "assignedProducts": [ "antivirus" ], "cloned": false, "device_encryption_status_unmanaged": false, "java_id": "2408cf5b-669c-434e-ac4c-a08d93c40e6a" ...

Experiencing a 400 Bad Request error while attempting an Ajax call to a Controller in ASP.NET

Having trouble making a simple request from a CSHTML page to a Controller in my ASP.NET MVC website application. Attempting a DELETE call using Ajax: $.ajax({ url: "/company/delete", type: "DELETE", success: function (e) { showAlert(&a ...

Ways to extract a value from an HTML form in ASP.NET when using Html.EnumDropDownListFor

I am a beginner in ASP.NET and I recently set up a form that allows input from a C# enum: <form method="get"> <div class="form-group"> <label>Select Type:</label> @Html.EnumDropDownListFor(x = ...

Database with socket capability for efficient memory storage

Python, SQLite, and ASP.NET C# are on my mind. I need an in-memory database application that doesn't store data to disk. Basically, I have a Python server receiving gaming UDP data, translating it, and storing it in the memory database engine. Avoiding w ...

Using jQuery to Send Data Back to Parent Popup Window

Is there a way to achieve the following functionality with jQuery: create a popup window that sends a value back to the main window when a link in the popup is clicked, then closes the popup and automatically submits a form in the main window based on the ...

Every time I use Get for ajax calls, I keep getting hit with a frustrating

Initially, I was making a call to a [web method] using the POST method. However, since I need to receive data back, I attempted to switch to using the GET method instead. The previous implementation using POST was successful. Unfortunately, using GET resu ...

Minimize overlap across both projects

One scenario is having two projects that utilize a lot of the same components. How can we minimize redundancy between them? Is there a way to make them shareable? Perhaps leveraging webpack could be the solution? ...

More efficient methods for handling dates in JavaScript

I need help with a form that requires the user to input both a start date and an end date. I then need to calculate the status of these dates for display on the UI: If the dates are in the past, the status should be "DONE" If the dates are in the future, ...

What is the best way to obtain the output of a JavaScript function on the server side?

I'm dealing with a JavaScript function that returns an array in this particular format: <script type="text/javascript"> function looping() { var column_num = 1; var array = []; $("#columns ul").not("#colu ...

Is it possible to implement a real-time data update feature in a Gridview using ajax in C#

I've been working on updating my gridview automatically with the latest data using ajax in c#. I attempted to create an ajax post that calls my c# method, fetches the updated data, and then binds it to the gridview. However, I'm facing an issue where the d ...

Tips for transforming the appearance of an asp.net page with asp:Content into a stylish css-page

Currently facing an issue where I am unable to change the background-color in my CSS file. As a workaround, I have placed the style directly within an ASP page. <asp:Content Id="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> ...

Extract the text and value from an asp.net treeview by utilizing jQuery or JavaScript

On my website, I am using a TreeView controller. I have disabled node selection by setting SelectAction = TreeNodeSelectAction.None as I have the checkbox option enabled. However, this causes an error when trying to access the .href property of the node. T ...

Using jQuery and Bootstrap in an ASP.NET Core project

I am encountering an issue with the configuration of bootstrap and jquery within my project, causing these tools to fail to load properly. The problem seems to be that bootstrap is loading before jquery, resulting in error messages appearing when I check ...

When the if-else statement is executed, it showcases two strings:

Learning Experience: Unveiling My Lack of Cleverness Update: It appears that utilizing PHP in my current setup is not possible. As a result, I'll take some time to contemplate while banging my head against a wall. Despite that, thank you all for your ...

Configuring the interactive background for a textbox

How can I set a background image for a textbox that is clickable? I tried using a div tag with position:absolute positioned above the textbox, and included the image within it. However, the issue is that the image appears above the text. I attempted to a ...

Encountering a CORS error while attempting to send a POST request from Angular to ASP.net REST services, as the OPTIONS request is being denied

Every time I attempt to send a POST request, it fails. Chrome displays the following error message: OPTIONS http://localhost:49475/api/Kpi/new (anonymous function) @ angular.js:10661sendReq @ angular.js:10480serverRequest @ angular.js:10187processQueue @ ...

Is storing HTML tags in a database considered beneficial or disadvantageous?

At times, I find myself needing to modify specific data or a portion of it that originates from the database. For instance: If there is a description (stored in the DB) like the following: HTML 4 has undergone adjustments, expansions, and enhancements b ...

Sys.WebForms.PageRequestManagerParserErrorException captured without any prior warning!

It's incredible how peculiar this issue is that I'm facing in my programming journey. I've dedicated two whole days to finding a solution for the exception mentioned below, but unfortunately, I haven't been able to pinpoint its source. In my Asp.net 4.5 a ...

What is the best way to extract data from Azure Data Lake and showcase it within an Angular-2 interface?

I am facing a challenge where I need to retrieve files with content from Azure Data Lake and display them in an Angular-2 Component. The issue is that when using the List File Status() method, I am only able to obtain file properties, not the actual conten ...

Unique mechanism for tracking clicks in ASP and C#

Is there a preferred method for showing a click counter on an HTML page when working with a .aspx file that connects to a .cs file pulling data from a SQL server, without relying on an external text file for tracking purposes? I'm trying to avoid using J ...

Transforming the MVC model attribute into an HTML attribute

Is there a way to include model attributes in the HTML input tag? Code [Required] [StringLength(20)] public string Username { get; set; } [Required] [StringLength(20)] [DataType(DataType.Password)] public string Password { get; set; } Expected Output: ...

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 ...

Invoking an *.aspx method from an external HTML file

Greetings, I am a newcomer to the world of web application development. I have successfully created an *aspx page that communicates with a webservice through a method returning a string. My next goal is to invoke this aspx method from a remote HTML 5 page ...

Pass the DateTime object from ASP.NET to angularjs as a structured data type instead of converting it to a

I'm encountering an issue where I am sending a complex object from my ASP.NET backend to the AngularJS frontend. This object includes a DateTime property and a list of objects, each with their own DateTime property. These properties are all sent as strings ...

The Lifecycle of an ASPX Page when Invoking [WebMethod]s

Currently, I am utilizing jQuery ajax to call multiple methods that have been decorated with [WebMethod]. These methods rely on a database connection established in an external library, which remains consistent across all functions. In the initial impleme ...

Using npm in Visual Studio 2015 for managing numerous projects

One of my solutions consists of three web projects, and I want to use a package.json in two of them ('Site' and 'SatelliteSite'). These are ASP.NET 4 projects where I'm integrating npm/gulp/bower. It's working well for one pro ...

Is there a way to add zebra striping to a gridview that is already using jquery tablesorter?

I have a GridView in my asp.net application that utilizes the tablesorter plugin: $(document).ready(function() { $("[id$='_myGridView']").tablesorter({ sortList: [[0, 0]] }); }); Is there a way to implement zebra striping that updates when the t ...

Currently struggling to retrieve data from an AJAX post request within a C# controller

I need assistance with sending data from JavaScript to a C# controller using AJAX. However, I am facing an issue where all the arguments in the Add method of my controller are showing up as null. Below is my AJAX code: function sendRequest(name, price, ab ...

Stop the submission of a form in jQuery if a file with the same name already exists

Currently, I am utilizing MVC3 and have a form containing a file upload feature. My goal is to prompt the user for confirmation if the uploaded file already exists on the server. To achieve this, I have implemented a jQuery method within the form submit fu ...

The HTMLEditor from ASP.NET AJAX Control Toolkit is not appearing correctly on the page

My experience with the ASP.NET AJAX Control Toolkit HTMLEditor has been less than satisfactory. The toolbar layout is not being displayed correctly, with what should be a 3-line toolbar appearing stretched out to 9 lines. ...

Encountering a problem with AJAX displaying error code 80020101 while attempting to retrieve a string from a

I encountered an error while running my code: Microsoft JScript runtime error: Could not complete the operation due to error 80020101. I came across this thread on Stackoverflow that talks about a similar issue: Ajax request problem: error 80020101 var d ...

Tips for retaining focus on the same control following an asynchronous postback

I am experiencing an issue with my 3 textboxes, where one is placed in an update panel that refreshes every 4 seconds. Unfortunately, during the refresh process, the focus on controls outside of the update panel is being lost. I need a solution to maintain ...

Having trouble connecting to the webserver? Make sure the web server is up and running, and that incoming HTTP requests are not being blocked by a firewall

While working on my Visual Studio 2013 Asp.Net web code using the Local IIS Web server Version 7 (Windows 7 x64) and Framework 4.0, I encountered an error message stating: "Unable to start debugging on the web server. Unable to connect to the webserver. V ...

Troubleshooting issue with RadioButton check change not updating in onPost event in ASP.Net project utilizing Bootstrap HTML and C

Having created two radio buttons, grouped them together, and applied bootstrap classes for styling; I am encountering an issue where the values of the radio buttons are not updating when clicked and submitted. Interestingly, the checkboxes on the same form ...

Troubleshooting ASP.NET Ajax and Validator Issues

My web form contains several elements like a TextBox, SaveButton, RequiredFieldValidator, DataGrid, and a paging button all housed within a single UpdatePanel. The SaveButton is responsible for saving the value in the TextBox to the database and updating t ...

Is it possible for AJAX JSON response to return both accurate and undefined values sporadically?

In the process of developing JavaScript code to pinpoint the smallest unused number within a specified range of numbers, I encountered an issue with the AJAX request. Despite successfully retrieving all used numbers in the designated range, some undefined ...

Looking for a way to add a CSS effect that reveals another image or text when hovering over an image?

My company's website features 10 country flags that, when clicked, display the entire site in that country's language for the user's session. However, I want to take it a step further and have a small image of the respective country appear w ...

Names like jQuery and ASP.NET are well-known in the world

What is the proper method to select a control rendered by ASP.NET using jQuery? For instance, if there is a checkbox generated as: <input id="ctl00_Content_chkOk" type="checkbox" name="ctl00$Content$chkOk" /> Attempting to check if it's checked by ...

Incorporating VueJS into a complex WebForms project with multiple pages

I'm currently working on a webforms project and I would like to incorporate VueJS into it. However, I am facing challenges when trying to set up the root element. If I enclose my content within a <div id="app"></div> element and specify this a ...

What are some strategies for sorting information from a list that is constantly changing?

I have been working on a web application built in asp.net that receives data from a web service in JSON format. The current task is to dynamically develop controls for this application. I achieved this by creating a list of labels with stored values using ...

What causes the entire page to refresh when using ValidatorCallOut in the Ajax Control Toolkit?

After downloading the Ajax Control Toolkit, I am trying to integrate its components into my project. I have utilized the ValidatorCallOut Component as an extender for a Textbox, so that when the user switches focus to another Textbox, the ValidatorCallOu ...

The importance of ensuring the security of JSON and web services

I have a unique situation where I am seeking specific advice on multiple questions related to my ASP.NET app. The application interacts with a SQL Server database through a web service, using JSON for creating JavaScript graphs and charts. Given the extens ...

Error Encountered: SyntaxError due to an Unexpected token < found in JSON at position 0

I am struggling to retrieve data from a local asp.net API running on https://localhost:44388/. When attempting to make a GET request, it returns HTML instead of JSON. There are two possible reasons for this issue: 1. Typo in the URL (I have verified in m ...