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 to implement the onRowClick event in ASP.NET Gridview to show record details without using a Details/Select button

I'm currently working with a gridView and have configured a button within it to display detailed information when clicked. This button calls the DetailsView() function, which executes an SQL command and binds the data to a repeater for a custom details vie ...

Installing npm without the need for Node.js can be achieved

Looking to set up an ASP.NET Core Web Application in Visual Studio 2015 and have plans to incorporate AngularJs2 with TypeScript editing. To make this work, I need to set up the npm Package Manager. Ideally, I want to install npm without node as I will n ...

The reasons behind the static nature of Ajax pagemethods

What is the reason for Ajax pagemethods being static? ...

Tips for successfully retrieving a boolean value from an ASP.Net JavaScript AJAX request using a C# method

Query: Is there a way to call a C# function from JavaScript code on an .aspx webpage to get authentication results based on a username and password? Here is the JavaScript AJAX POST request I am currently using: $.ajax({ type: "POST", ...

JavaScript method to prevent users from entering numbers as the first two characters, with all subsequent characters being numbers only

I need a specific requirement for my form. The textbox field in my form is labeled "DEA License number", and I want it to only allow the user to enter alphabetic characters for the first two characters, followed by numbers afterward. I am looking to impl ...

"Exploring the method of adding information to a table with the help of

Here is the structure of my HTML table: <table id="tableOrderDetail" class="table-striped table-bordered" style="align: center; width: 100%;"> <thead> <tr> <th width="5%">Sr. No.</th> <th width="25%">Product N ...

What is the best way to automatically refresh a page every minute using ajax?

Is there a way to automatically update a specific div on my page with the minute of the match every 15 seconds? I want to refresh only that particular area where the div is located. <script> setInterval(function () { ...

Use jQuery AJAX to add a new record to a webmethod and refresh the dropdown list with the updated

After successfully adding a record via a jQuery AJAX call to a web method, I would like to update the dropdown list without using an update panel. What is the most efficient way to accomplish this? Thanks! ...

What is the procedure to modify a CSS class from the code-behind file?

So I have a CSS style in my .css class where the color is set to blue for hundreds of buttons. But now, my customer wants an option for green buttons which will be saved by a database field. So I check the field like this: if (!String.Is ...

Using jQuery, disregard elements that are not hidden

Currently, I am working with a jQuery validator and I am attempting to utilize the ignore: ':hidden:not feature for all controls that contain an ID with " selecting" in it. Here is my current code snippet: sb.AppendLine(@" ignore: ':hidden: ...

Transform IEnumerable into a JSON object

Recently, I have started exploring the world of IEnumerable and Linq. My main focus has been on finding a way to convert IEnumerable objects into JSON format. During my search, I came across a thread on this topic: How do I convert an IEnumerable to JSON?. ...

Encountering issues with Html.ActionLink in Asp.net MVC when using Bootstrap Select

I am trying to implement a dropdown list for language localization on my website. However, when using <ul> tags with Html.ActionLink, the links are created with language codes as shown below: @{ var routeValues = this.ViewContext.RouteData.Valu ...

Making a Cross-Origin Resource Sharing (CORS) request with jQuery utilizing the $

I am currently in the process of building a web application that relies heavily on data from multiple domains. Approximately 90% of the requests made by my application are cross-domain requests. However, I have encountered an issue where I am unable to re ...

Tips for choosing a subset of objects within a larger array of objects and generating a new array from them?

I am working with an array of 3586 objects, each containing various products. How can I create and store a new array that only includes the products from a specific index? console.log listarPorReferencia() { this.linxService.listarPorReferencia().subs ...

Regular Expression for valid Mobile Phone Number country code starting with 0092 or +92

Have you come across a standardized regular expression that captures all valid mobile phone numbers, such as 00923465655239 or +923005483426? I've been searching for it for two days but haven't found an expression that fits these formats. The co ...

What could be the issue with this C# GridView code snippet?

I am facing an issue with a GridView that contains checkboxes. When I try to select a checkbox, I need to retrieve the values from that specific row. The problem lies in the fact that the chk variable in my C# code never evaluates to "true," preventing the ...

Issues arise when attempting to utilize a jQuery function to call an asp.net web method

In my ASP.NET project, I have a web method that looks like this: [WebMethod] public string getCurrentDate() { return DateTime.Now.ToString(); } My jQuery ajax call to this web method is as follows: $.ajax({ type: "POST", url: "jqueryAjax/Defau ...

How can you make each <li> in an HTML list have a unique color?

Looking for a way to assign different colors to each <li> element in HTML? <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <ul> Here's how you want them displayed: Item 1 should be red Ite ...

What is the proper way to invoke a function in the code-behind using JavaScript?

I need to invoke a function in the code behind from JavaScript Button : <button class = "btn btn-outline btn-danger dim" type = "button" onclick = "confirmDelete ()"> <i class = "fa fa-trash"> </i> ...

The JSON outcome lacks a constructor that supports 0 arguments

While trying to create my JSON action, I ran into an issue. The problem lies in the fact that when I try to return a JsonResult, it is being flagged with an error message stating 'JSON result does not contain a constructor that takes 0 arguments'. I am un ...

When certain triggers are activated, a hidden textbox revealed through javascript is made visible

After changing a dropdown value (from ddlSource) and hiding some text boxes using JavaScript, everything works fine. However, when the user enters a certain value in another textbox triggering an AJAX call to populate some labels, upon form reload, the hid ...

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

Panel not refreshing its content after update

I've been working on this for a while, but I'm still stuck. Here's the code from the aspx page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns= ...

What is the best method to utilize a jQuery selector on an expando property that works across different web browsers?

Having some trouble with my ASP.NET page and jQuery selectors. I need to match validation controls connected to specific textboxes, but the selectors aren't working consistently across different browsers. Here's a test example: <html xmlns="http://www. ...

Trouble with AJAX Post Request: Missing JSON Response

Below is the AJAX request I have created: var data = modalDom.find("form").serializeObject(); data["returnJson"] = true; $.ajax({ type: "POST", url: "/companies/edit/", data: data, dataType: "JSON", success: function (result) { ...

Performing a function when the ondrop event of a <li> element is triggered

Is there a way to trigger a code-behind click function on the ondrop event of an <li> element? Additionally, I would like to know if it's possible to force a postback on the onclick event. Any ideas on how to achieve this? Just to clarify, thi ...

Incorporate Bootstrap toggle functionality using ASP.NET Core MVC Tag Helper

I'm currently developing an asp.net core mvc app and I'm fairly new to .net core. I am really intrigued by tag helpers and trying to grasp them. I understand the simple ones, but I need help replacing <input type="checkbox"> with bootstrap toggle whi ...

ASP.NET - The Power of a Long Press

I am currently working on implementing a Long Press event in JavaScript on an ASPX page. Due to my limited experience with JavaScript, I am facing a few challenges. I found a similar question that was previously asked here. When running the code, I encoun ...

Errors in the Latest Release of Angular2 and Visual Studio 2015

After taking a stroll through the Angular 2 Tour of Heroes sample application with the latest Angular 2 version, I decided to host it within a Visual Studio 2015 Empty Web application. Following the Angular sample closely means that I'm not incorporat ...

Accessing Excel files through Ajax and MemoryStream successfully downloads new Excel files; however, this method may not work for existing Excel files already stored

Currently, I am working on a .Net 6 Razor pages application where I have successfully implemented the functionality to download an Excel file on a button click via Ajax. The approach involves creating a new Excel workbook in memory stream using OpenXML. C ...

The callback for the Ajax request failing before entering the webmethod function

Below is the Ajax request I am using: $.ajax({ type: "POST", url: "ProductDetail.aspx/AddCart", data: '{productId:' + 4 + ',productTypeId:' + 0 + ',quantity:' + 1 + '}', contentType: "application/json; char ...

JSON function invocation is failing to load

This is my JavaScript script, When I call the function calculate(), the JSON method ConvertDataTabletoString() only gets called once, when I load the page. I want the method to be called every 5 seconds. I am calling a VB.NET function in .aspx. How can ...

Steps for triggering a modal popup using server-side code when a button is clicked

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="3.aspx.cs" Inherits="KVTRANSAPORTS._3" MasterPageFile="~/Site1.Master" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> <script src="Sc ...

Sending a request via AJAX to retrieve a complicated object

Programming Environment: ASP.NET, jQuery Below is the AJAX call I am using: var tempVar = JSON.stringify({plotID:currentId}); $.ajax({ type: "POST", url: "testPage.aspx/getPlotConfig", data: tempVar, contentType: ...

Share an ASP.NET Model in serialized form along with a file containing just one Jquery Ajax call in your ASP.NET MVC project

Currently, I am working on a project to create a movie library application using asp.net. While designing the admin page, I encountered a challenge with adding movies to the database. Specifically, I needed to gather details such as name, actors, and poste ...

Python Code to Extract Information from an ASPX Website Using Web Scraping

Struggling to scrape a static .aspx url where all attempts result in getting the raw html data of the regular website instead of the desired query results. Confident that the headers being used are correct and can be generalized, discovered from another p ...

I am having trouble retrieving a JsonResult from an asp.net mvc controller using $resource in angular

I am new to Angularjs and trying to integrate it with asp.net mvc. I am facing an issue where I am unable to access an asp.net mvc controller to return a JsonResult using $resource in angular. Strangely, when I use $.getJson in JavaScript directly, it work ...

The ASP.NET Web service is proficient in transmitting data in the form of JSON

A while back, I developed an "ASP.NET Web Service application" using the .NET 3.5 framework. Lately, the number of requests to this application has significantly increased and I am facing bandwidth issues on the server. My initial thought to optimize the ...

Unable to reach webmethod with jQuery Ajax post request due to URL rewriting

I am having trouble with my jQuery AJAX function not calling my webmethod. Take a look at my code below: $.ajax({ type: "POST", url: "Search.aspx/GetCustomers", data: '{pageIndex:' + pageIndex + ',searchText:"' + $('#H ...

How can I retrieve the selected items from a Listbox control?

Currently, I am working on an ASP.NET application using C#. One of the features in my project involves a Grid View with a Listbox control. The Listbox is initially set to be disabled by default. My goal is to enable and disable this control dynamically bas ...

Tips for avoiding duplicate elements in ASP.NET during postback

My issue is that I have a div with the ID "mydiv" and runat=server. <div ID="mydiv" runat="server"></div> I move mydiv to a Container using jQuery. $("#mydiv").appendTo('#Container'); After a PostBack, my div gets duplicated and I ...

Getting started with ASP.NET vNext 1.0.0-rc1-update1 live stream!

We began working on the project in beta 7 and successfully implemented most of the functionality in version 1.0.0-rc1-update1. Our primary authentication method is MVC and we use web API to provide data. The majority of the functionality resides in client- ...

Reset jQuery validation when a button is clicked

I need assistance with a form validation issue. I am using jQuery validation methods to validate the controls on my form. However, I am facing difficulties in clearing the validation when clicking on 'cancel'. Below is the code snippet: <script type=" ...

Deactivate the other RadioButtons within an Asp.net RadioButtonList when one of them is chosen

Is there a way to disable other asp.net radio buttons when one of them is selected? I have three radio buttons, and I want to disable the other two when one is selected. After doing some research, I managed to disable the other two when the third one is se ...

The OK Button Dialogbox is currently malfunctioning

While using jQuery for a dialog box, I encountered an issue when trying to delete an element within it. After clicking the ok button, the dialog box did not redirect or close itself properly. The initial content in the dialog box seems to work fine. < ...

The PartialView is currently displaying the entire page instead of just rendering the form

I'm attempting to refresh the partialview exclusively within my modal, following the ajax request. However, upon receiving the response, everything gets refreshed and only the partialview is displayed. Here is the PartialView: @{ var bidModel = new B ...

Most effective method for performing partial updates to content in ASP.NET

My initial plan was to utilize a master page for every page within my application. However, I soon discovered that every time the page changed, it would reload the full page even if it had the same master page. I realized I had confused the frameset with t ...

When attempting to change the text in the textarea by selecting a different option from the dropdown list, the text is not updating

I am facing an issue with three multi-select dropdown lists. When a user selects options from these lists and then presses the submit button, the selected text should display in a textarea. However, if the user manually changes some text in the textarea ...

Retrieving a specific time using a JavaScript interface

I am currently implementing a JavaScript control that can be found on this website: My question is, how can I retrieve the selected date from the control in order to pass it to a postback page? I attempted to figure it out myself, but my JavaScript skills ...

Unable to implement CSS styles on the provided HTML code

I'm currently working on integrating evoPDF into my asp.net application. When I click on a part of the HTML file, I send that portion using AJAX. So far, everything is working well up to this point. However, when I try to use the following methods fro ...

Processing files with Ajax in Telerik RadAsyncUpload

When utilizing radasyncupload on my asp.net page, I encounter an issue with storing the uploaded files to a database as byte arrays. After uploading the files, I aim to trigger an Ajax call upon clicking a button in order to transfer the files from the t ...

issue with selecting tabs in jquery

I need help with a problem that is connected to my previous article on CSS, button selection, and HTML tags. You can find the article here. I am not very proficient in JavaScript, so I would appreciate any insights or guidance on how to tackle this issue. ...

Instructions on calculating the sum of a checkbox value and a textbox value

Here, my goal is to dynamically calculate the total value of selected checkboxes (Checkbox1 and Checkbox3) with the value in TextBox1, and then display the sum in TextBox2 without the need for any button click event. <div> <asp:Tex ...

Is your Jquery validation malfunctioning?

I am currently facing a challenge with required validation on an asp.net page. In order to validate the inputs, I have implemented multiple controls which can be hidden or displayed based on certain conditions. These controls include checkboxlists, dropdow ...

Add compressed files to the website when publishing through Visual Studio

In my current project using ASP.NET 4.6 (not 5.0/Core), I have encountered a situation where some of the necessary JS libraries are only available through NPM. To address this, I am exploring the relatively new NPM and gulp-based pipelines suggested by Mic ...

Shift the attention from the text box to the AJAX combobox when the enter key is pressed

I need to make it so that when I press the enter key in a textbox, the focus shifts to an ajax combobox. <script type="text/javascript"> $(document).ready(function () { $("#txtGroupSname").keydown(checkForEnter); function checkF ...

Anyone able to solve this mysterious CSS alignment problem?

I have a search bar with two image buttons on a webpage I designed using ASP.NET. When I view the page in Internet Explorer 8, Google Chrome or Opera, I noticed that the textbox and image buttons are not aligned properly. The buttons seem to be positioned ...

These specific resources don't have a cache expiration set. Wondering how to properly set a cache expiration for a JavaScript file

I am working on a web application that utilizes external JavaScript files. Upon running Google's page speed tool, I realized that several resources are missing cache expiration settings, including images and CSS files. Can you provide examples of how to s ...

"Sending image data in base64 format to a server: A step-by

Instead of directly selecting an image, I decided to dynamically display it using base64 encoding. <img style="width: 412px;" src="data:image/gif;base64,R0lGODlhwAAAAXAAACH5BAEAAPwALA Is there a way to send this image to a server without triggering a ...

Exploring Angular Applications with Search Engine Crawlers on ASP.NET

I am currently using AngularJS for my website's front end, and ASP.NET for the back end. I am in need of a headless browser that can easily render content on the server side for web crawlers. I have been looking into Awesomium.NET and WebKit.NET, but t ...

Deploy your Next JS project using the ASP.NET Core Visual Studio React template

After deciding to enhance my project that began with the asp.net core react template in Visual Studio by adding SSR capability with Next.js, I encountered an issue. Previously, when clicking on the run project button in Visual Studio, both the API server a ...

Troubleshooting ASP.NET Content Page Error: jQuery Object Expected

Currently working on designing a personal ASP.NET Web page, I have encountered an issue with making a sticky div using jQuery. Despite all my other jQuery functions functioning properly, the sticky div seems to be causing trouble. stickydiv.js $(document ...

The second click on ng-click does not seem to be functioning properly

Hello, I am new to AngularJS. I have managed to fetch the required data, but I'm facing an issue where clicking doesn't work for the second time. I have tried multiple solutions but none seem to be working. Could someone please help me solve this ...

A Foolproof Method to Dynamically Toggle HTML Checkbox in ASP.NET Using JavaScript

Although there have been numerous inquiries related to this subject, I haven't been able to find a solution specific to my situation. I currently have a gridview that contains checkboxes. What I'm trying to achieve is that when I select the checkbox for e ...

Using jQuery to post forms in ASP.NET

Looking for guidance on using jQuery form posting on an ASP.NET page with 2 text boxes and a drop down list instead of normal post back. How can server side controls be accessed in the action page without passing everything via query string? Any advice o ...

ajax request encountered access denial when attempting to call wcf service

I have set up an Amazon EC2 instance and deployed my .NET web application on port 80, with the WCF service running on port 1212. While I can access both the application and service locally on the remote session, attempting to make Ajax requests over the i ...

`CSS Content Placeholder Issue When Used Alongside JavaScript`

Let me explain a bit, I have a master page named UserProfile.master which has a content placeholder linked to UserProfileWall.aspx. Now, I am trying to incorporate some additional JavaScript and a second CSS file in the userprofilewall page. However, whene ...

Fixed position not being maintained after clicking the button

Looking for some help with a fixed header issue on my website. The header is supposed to stay at the top while scrolling, which works well. However, when I switch to responsive view, click the menu button, and then go back to desktop view, none of the po ...

Transforming a web form into razor format flawlessly

I've been attempting to switch over to razor, but I keep encountering an error. <% AjaxOptions settings = new AjaxOptions(); options.HttpMethod = "POST"; %> @AjaxOptions configuration = new AjaxOptions(); options.HttpMethod = "POST ...

What is the best way to embed two controllers within an AngularJS webpage?

Currently, I have a Web Forms ASP.NET website that I am trying to enhance by adding an AngularJS page. This page is meant to interact with my RESTful Web API to display quotes for selected securities upon button click. While the Web API calls work when dir ...

Is ASP.NET capable of displaying an expandable grid view?

After searching online, I have yet to find a solution that meets my requirements. Currently, my DB view generates the following data: --------------------------------------------------- Company | Code | Total | Available | Used | Needed ---------------- ...

Issue with deleting data from database using the script

I am facing an issue with deleting records using a button on the Index webpage. I tried using jQuery with AJAX, but it does not seem to be working correctly. Here is my controller method which works fine when called from a form generated by another page u ...

Manipulating DropDownList Attributes in ASP.NET using JavaScript

I am facing an issue with populating a Dropdownlist control on my ASCX page. <asp:DropDownList ID="demoddl" runat="server" onchange="apply(this.options[this.selectedIndex].value,event)" onclick="borderColorChange(this.id, 'Click')" onblur="bo ...

Issue with smart table sorting functionality

I've been working on a table with just one column that is populated from a string array. However, I'm struggling to get the sorting functionality to work properly. Can anyone pinpoint what mistake I might be making here? Steps taken so far: 1) Double-ch ...

How to reference a ListView control using its DataSource in a C# class

Currently, I have a ListView embedded in a webpage connected to a C# class datasource called CommentsDAO. This class contains the necessary methods to retrieve or delete data from the ListView. While data retrieval is successful, deleting a row proves to b ...