Newest 'asp.net' Questions

Q&A for professional and enthusiast programmers

Login to a Website Programmaticaly in Asp.net

I want to extract data from HTML of a website that needs to be logged in. I am searhing the web for 4 days with no clear results. I need an answer for Asp.net/C#. The information I collected so far: ...

Setting MaxClientRequestBuffer for azure web app?

I want to upload a file with metadata. Unfortunately packing the file into the json is out of the question. So, my idea to still do the upload in one call (so that it can succeed or fail atomically) ...

report viewer in visual studio 2015 is not drop on form in asp.net

I have installed reportviewer 11.0.0 and it is showing in toolbox but when I drag it and drop on my web form nothing happen. report viewer is not showing on form and also there is no code of it ...

i am trying to work on asp.net to create a table that connects to the datable but the structure of the table is a bit hard for me to create

how do i create a menu table that connects to the database with 4 columns and 10 rows with next and previous button. and A search button. with a drop drop down that shows number of entries

reCaptcha - reading JSON response

I get a response from the reCapture and need to read the "success" value, but get the error: Public member 'success' on type 'Dictionary(Of String,Object)' not found. Response { "success": true, "...

not enter in controller when using script of create input file for upload

i need to use dynamic upload form . i used this script for add input file in asp mvc : <button type="button" onclick="adduploadfile()" class="btn btn-success">افزودن فایل</button> * ...

Add JavaScript Reference in asp.net core

Below is my Problem : GlobalJs.js is my custome JavaScript file and has only one line code alert(1). But I am unable to add its reference in _Layout.cshtml. src="../...

How to add a hard coded value to an object in a class from unit test for testing purpose

[HttpGet] public IHttpActionResult GetTerm() { Response resp = new Response(); resp = InfomationController.GetTermAndCond(); //line 'LI001' return Ok(resp); } [TestMethod] public void ...

Architect ASP.NET MVC with Polymer

I have built already 3 apps using ASP.NET MVC and Polymer but I always end up with the same architectural problem. At the moment, if I want to keep separated the MVC Views from the Polymer ...

how to convert json string to object in C#

Its been a day scratching my head & googling on how to convert json string to an object. This is my json. { "statusCode": 200, "data": { "items": [ { "id": 2623, "JsonData": "{\"...

Bypassing the browser cache by asp-append-version not working in iframe

I have used the asp-append-version="true" for bypassing the browser cache but it's not working when I used it in iframe. Do I have to change my solution?

ASP.NET Gridview the server tag is not comes

<div style="width: 960px; float: left;"> <asp:GridView ID="gviewUserDetails" runat="server" AutoGenerateColumns="False" CssClass="gridStyle" AllowSorting="True" Width="100%" ...

Google rich card Javascript throws error

I am trying to add a Google rich card to my E-Commerce shop Product page. <script type="application/ld+json"> { "@context": "http://schema.org/", "@type": "Product", "name": $('#<%...

How access modifying differently among few projects?

I have three project C# projects UserMangment, Admin and Client. User management has GetUser, UpdateUser, CreateUser and DeleteUser methods. Both admin and client has a reference to UserMangement. I ...

How to get Woocommerce Rest Api shipment tracking info into c#

I am using Woocommerce rest api into my asp.net mvc application using C#. How to get shipment tracking info of orders. My code is - string url = StoreUrl + "/wp-json/wc/v1/orders/"+ orderId + "/...

How to manage dynamically added asp.net controls with Control.AddAt in c# when during user navigation a Control could be disabled

My situation is complex, this is a simplified test, but by solving this, maybe I solve my complete problems. I have a webform with some imagebutton. Some added in frontend, some at runtime in the ...

Data Fetching in asp.net using my sql db? [on hold]

While try to get the 30000 plus records repeater did not show the records but restrict the limit of the records to 10000 in MY SQL it shows the data. what can i do to solve this?

Gridview controllers null after inserting column

I am developing a Web App for managing Student exam entries but I am coming across an issue with my gridview. The basic idea is that a user can go on and enter and update details on a students exam. ...

cannot convert from 'System.Collections.Generic.IEnumerable<x>' to 'x' when using auto mapper

i have NewsViewModel , it include : public class CategoryViewModel { public CategoryViewModel() { List = new List<CategoryModel>(); } public IEnumerable<CategoryModel&...

Report Error in the software (aspnet mvc) [on hold]

Hi I have clockwise finger print software. Datepicker with from and to dates is there and when we click generate report within those dates is created. But from Jan 1, 2017 no data shown in report. ...

Jquery fadeout on click

Anyone knows what's wrong here? Javascript function editDayClicked() { $("#UserCalendar").fadeOut({ duration: 1500 }); $("#UserDayData").fadeOut({ duration: 1500 }, "swing", function () { ...

How we can call a powershell script on a button in asp.net application?

I am currently working on a asp.net web application. There are 3 buttons in the application on which i have to call 3 separate powershell scripts. I have no clue how to call them by the click of a ...

System.OutOfMemoryException in WebGrid

Everytime i access my page which should display an WebGrid i get an System.OutOfMemoryException while the WebGrid is building up. Is there a way to resolve that problem without exchanging the Hardware?...

XmlSerializer “System.InvalidOperationException” when I use property order

Why is XmlSerializer throwing an InvalidOperationException, when I use Order ( [XmlElement(ElementName = "name",Order = 1)]) in my class? But I use [XmlElement(ElementName = "name"] - XmlSerializer is ...

Asp.net web, update a display as each record is looped through… 1 of X as records are loaded

I have a asp.net web application being written in VB which requires records to be uploaded from an external file. I want to be be able to update the user as each record is processed. What is the ...

Redirection to external page within web forms application

I have a WebForms application ( .Net Framework 4.5.2) . I need to redirect some pages to external web page example www.google.com I tried to modify the routes public class Global : HttpApplication ...

Daterange with startDate and endDate not working if both date same

I get the data returned of the selected date range which is between the range or isnt. but not if the startDate and endDate is the same. Like example: from 14.10.2017 - 14.10.2017. It returns me then ...

How to dynamically add GridView in Panel

I'm trying to add GridView in Panel dynamically but its not added. Here is my code: DataTable dt4 = new DataTable(); dt4.Columns.Add("New"); dt4.Columns.Add("New1"); dt4.Columns.Add("New2"); GridView ...

SignalR Server side method call from Client side in Non MVC project

I'm familiar with WebMethods and PageMethods to call Server side methods from the client side without refreshing page. I'm achieving to Invoke Server-side method (present inside index.aspx.cs). Here ...

Allow to see/edit specific fields for specific roles

Good day. I have many users, many roles, many models, cookie auth, ASP.NET Core. I need to restrict access to specific fields of the model for each role. For example: class ModelA { public int Id {...

Dynamic image add in email body

I have html page, which contain a div <div style="background-image:url(cid:bodyimage); no-repeat scroll;background-size: 100% 100%;width:100%;font-family: calibri;"></div> i want to add ...

System.MissingMethodException: Method not found: 'System.String System.CodeDom.Compiler.CompilerParameters.get_CoreAssemblyFileName()'

My Asp.Net MVC application is working fine on my machine (IIS). When I deployed this on Windows Server 2008 R2 IIS, I am getting below error: [MissingMethodException: Method not found: 'System.String ...

RSA error on WCF Services

I have recently encrypted our .NET web config files for our ASPX web applications using RSA encryption. It works fine for our web applications. However, its not working in our WCF Services, the ...

Session not created null reference exception in asp.net

I doing with sessions. On first page I have code Response.Redirect("welcome.aspx"); Session["me"] = TextBox1.Text; and on welcome page I am writing this code on form load event if(Session["me"] != ...

How can I develop a gRPC plugin that handles the transmission of request ID through c# generated code?

I have many microservices en .net communicating with each other via gRPC (I use "protoc.exe" and "grpc_csharp_plugin.exe" to generate the client and server parts). Now I need that the gRPC request ...

Reading Data from DB throws index out of range exception

Screenshot of Exception I am importing data from excel and then want to read it from the DB and display it to the user. everything is working fine except these two consective lines throwing the same ...

mvc Manupilate WebRequest Onlydisplay specific parts

Loading An external webpage (html) into an string variable using the code below: WebClient webpage = new WebClient(); string url = "<url to page>"; //remove <div ...

How to trigger SelectedIndexChange before postback?

My page has two controls and the content of the second depending on the dropdown in the first one. I have an issue because the event SelectedIndexChange is triggered after my postback. I tried with ...

Add text on image and save into database [on hold]

I want to take the physical path and add text on image save in a database. But an exception happens and shows null in Inner exception string promotionImage; addpromotions.PromotionImage = file....

Values from asp net form to Dto

Going from this article here what i am looking to do is to get the key value pairs sent by an aspnet/html form and then put them into a dto that i can then use elsewhere in my application. I see that ...

Prevent css and js inheritence in ascx

I have an application with only one aspx page (Default.aspx). This page loads .ascx controls as needed. All these controls are using the same JS and CSS file. Now I want to apply Bootstrap on some of ...

How to configure restrictions with Unity dependency injection?

I am using dependency injection with Unity in my ASP.Net web application. Suppose I create a simple service called MyService implementing IMyService. I would configure it like this in my ...

populate form fields by selecting drop down list in .net mvc without using javascript

I want to populate form fields by selecting the drop down list without using java script. I have model class name workcenter and i am using list of plant class as data member.below is my code. please ...

Filtering data, check if variable is empty before checking if variable exists in db

As title, I'm using EntityFramework, I have a page with 'trips' from which I get back my searchTrip object with all the fields that user has entered. He might have only entered some of them e.g. From ...

Bootstrap modal to get Datalist index

I currently has a Datalist, which has a linkbutton in the item template. <asp:LinkButton ID="getCountry" runat="server" data-toggle="modal" href="#sharedGroup" OnClick="getCountry_Click1">...

Debug=“false” breaks bundling

Over the weekend we have deployed a new version of an MVC web application to a Windows Server hosted in IIS 6. All of the CSS and Jquery files are configured to use bundling, on first deployment none ...

Google Maps API Error and Warnings

We have implemented a google maps element into our ASP.NET solution. For some of our deployments the maps are showing correctly but with 2 warnings: Google Maps API warning: NoApiKeys https://...

Set focus on particular sheet while exporting excel in multiple sheets

I'm using OpenOfficeXML to write data in excel workbook in my c# application. That contains multiple sheets and data. I want to make the focus on the 2nd sheet by default on completion of data ...

Deploy .net build files from one windows server to another windows server which is in AWS

I have two windows server 01 and 02. 02 is created in AWS and it has IIS where my site is hosted . Using Jenkins I am trying to push the build files from 01 to 02 . But I am unable to do it . Publish ...

Can i use JSON.Stringify in code-behind of an ASP.Net project

In the code-behind of an ASP.NET project (MVP-pattern) I get in one of the presenters a string which contains something which looks like the content of a JSON file. Then I set one of the properties ...
Translating... 0%