Questions tagged [asp.net-mvc]

The ASP.NET MVC Framework is an open source web application framework and tooling that implements a version of the model-view-controller (MVC) pattern tailored towards web applications and built upon an ASP.NET technology foundation.

0
votes
0answers
4 views

ASP.NET - SVG to PDF

I am trying to convert from view that there is file svg to PDF. See image below. enter image description here See that the word "Febraban" was disappeared... Does anyone know why? If image from PNG, ...
0
votes
0answers
6 views

Ext.JS: Reference model in JavaScript

Suppose I have a controller that returns a partial view: public class MyController : Controller { public Ext.Net.MVC.PartialViewResult MyPartialView(int id) { var model = _myFactory....
0
votes
0answers
24 views

Creating a listbox in a modal with files from a directory?

I am trying to grab files from a directory and I am trying to let the user select a file from a list to be later processed. This is the code that gets the files. [HttpGet] public ...
0
votes
0answers
12 views

MVC Controller. Handling JSON post with spaces in field names

There is a difference in Controller Types being able to handle incoming Posts with Field names that contain spaces. If the controller derives from ApiController it can handle the fields. If the ...
0
votes
0answers
17 views

Can i alter the contents of a data-bound mvc dropdownlist?

is it possible to alter the contents of a mvc dropdownlist? Specifically our issue is that it is possible for the id column to point to a filtered-out name because we are removing deleted items. ...
0
votes
0answers
14 views

Razor Class Library - Is there a way to compile all Pages/ as Pages/<module name>?

How can you automatically move all RCL pages to a sub-folder of Pages/, such as Pages/<module name> at compile-time, or at WebApplication import-time? I need this to be transparent such that, ...
0
votes
1answer
41 views

Can't see the date value from a <td> element in Date1

I am trying to compare two dates that are being pulled from a database. I am doing this all in ASP .NET mvc. Here is my Model class: public DateTime? Date1{ get; set; } public DateTime? Date2 { get;...
0
votes
0answers
9 views

mvc localization , resource files are not being loaded

I'm trying to make localization feature in my project I have <li>@Html.ActionLink(Resources.HomeTexts.Home, "Index", "Home")</li> for the menu. Also I have language switcher <li>@...
0
votes
0answers
24 views

Web.config authorization issue

I'm experimenting some issues with my web.config authorization configuration. I just want to allow any user to access on the "lost password" and "create account" pages, all other pages need to be ...
0
votes
0answers
12 views

Dedicated ActionResult (or page) for OWIN Authentication

I have an MVC application, and I have added some authentication methods to my startup, such as google, facebook, and some others. Among them are SAML and WSFed, and I would like to prevent the SAML ...
0
votes
0answers
20 views

font in image is not being shown

I have an image with some empty space on it. I have to add dynamic data from sql on to the image and during that process there should be a specific font applied to the dynamic text. The font is old ...
1
vote
2answers
38 views

Regular expression in RegularExpressionAttribute behavior

I am using this regular expression: @"[ \]\[;\/\\\?:*""<>|+=]|^[.]|[.]$" First part [ \]\[;\/\\\?:*""<>|+=] should match any of the characters inside the brackets. Next part ^[.] should ...
0
votes
0answers
18 views

Error when Filter data: 'There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'CountryIdSelected'.' [duplicate]

When i want to select data with a dropdownlist using method POST and ViewModel I have the following error. System.InvalidOperationException: 'There is no ViewData item of type 'IEnumerable' that ...
2
votes
1answer
15 views

User-Defined Table Type insertion causing conversion error

Not a duplicate of User-Defined Table Type insertion sometimes causing conversion error I have a user defined table type: CREATE TYPE [dbo].[udtImport] AS TABLE( Name varchar(256) null ...
0
votes
0answers
19 views

Calling html with Ajax request from js file OR using Razor methods

I am not sure if the title of my question is ok. I tried to google it but there is not any topic about it. I am using VS 2017 with MVC project, i have faced two ways to call view (html): 1st way-...
0
votes
1answer
27 views

Check if jquery function name is unique (and html id)

I have a MVC ASP.net project (in Visual Studio), which becomes bigger and bigger. Is there a way to check if a jquery function is unique ? For example, I have a function Foo() and I would like to ...
0
votes
1answer
45 views

How to dispose the ContextDB class automatically after any query done using it

ASP.NET MVC 5 Project. I know that the best practice of using EF context object as the following using(var context = new ContextDB()) { } But I am working with a large existing project which not ...
0
votes
0answers
12 views

Format in CSV OData endpoint output

I'm developing a OData endpoint using OData v4, Microsoft.aspnet.odata (v7.0.1); Microsoft.aspnet.webapi.odata v5.3.1 and Microsoft.data.odata v5.6.0 as libs. My question is the following: I have to ...
0
votes
0answers
21 views

MVC ASP NET Core, Keeping Routing URL with ActionLinks

I'm struggling to keep my routing links when using Html helper ActionLinks. I've set my routes similar to this: app.UseMvc(routes => { routes.MapRoute( name: "test1", ...
-1
votes
1answer
23 views

Filter ViewModel not works ASP MVC

I want to filter data with dropdownlist.For that, I created a ViewModel . I can display the data but the filter doesnotwork.When I select a country for exemple, I have the list of all the country in ...
0
votes
0answers
18 views

How to change value of one dropdown based on selection of other dropdown in MVC using Ajax and Razor?

In this example I am trying to use two dropdowns. The option elements generated by a Razor syntax (of second dropdown) should depend on whatever is selected in the first dropdown. So the first thing I ...
0
votes
1answer
22 views

Post Form with object collection

I need to upload Form, which contains several select lists of the same type. The form look like this View <form asp-action="UpdateFilter" asp-controller="Home" method="post"> ...
0
votes
0answers
9 views

Hosting and close a single-use connection via ASP.NET WebService

We have a supplier service which we access via a TCP/IP connection, but we can only ever have a single login active at any time. As this service is accessed from several apps we set up a WebService (...
0
votes
0answers
14 views

Unable to reload javascript cache even after versioning

I have a versioned JS file, in my asp.net mvc application, whose version changes everytime I change the version of the application - rather simple approach. Now, it has been a while since I made any ...
1
vote
1answer
30 views

select all checkboxes in a razorview table [duplicate]

I want to select all the checkboxes in table on clicking the header checkbox. I don't know how to do that. This is what I have done so far. <table class="table" id="myTable"> <...
0
votes
1answer
17 views

MVC reusing model

I have an MVC Web Application which uses a form to get a postal code from the user, which then queries an external web service and returns a list of addresses to the view. I had a previous issue ...
-1
votes
1answer
45 views

C# Interacting with Database In async way, not working.

I just wanted to create a dummy ASP.NET MVC project where i wanted to explore more about async & await.I created async methods in DB access Layer and Repository Layer and i also make sure that the ...
0
votes
2answers
36 views

ASP.Net MVC 5 Render PDF in Browser from Byte[] C#

I am working with Kendo MVC and I want to render an uploaded PDF into a Tabstrip. When getting the PDF file to show in the tab, I am calling my controller and subsequent service, getting the file ...
0
votes
0answers
9 views

asp mvc codefirst migration do not track changes in ApplicationUser

I have created mvc application, it created user AspNetUsers and other authentication related tables and models etc. by default it uses DefaultConnection I created MyConnection for all my models, and ...
0
votes
2answers
28 views

Why does $post not work but $ajax works on the asp.net web api controller?

I interested in knowing why does the $.ajax() request work but the $.post() returns just an empty array on the controller. controller [Route("api/actuary/{actuaryId:long}/documents/")] [HttpPost] ...
-1
votes
0answers
12 views

fetch user's data from two tables (payment table and withdrawal table) in mvc [on hold]

I need a partialview that fetches data from two tables and sort them by date in mvc5. payment table: UserID paymentid DepositDate Amount 17 1011 2018-07-28 100.00 ...
0
votes
1answer
19 views

paging and sorting issues having multiple grid.mvc grids in one page

I am trying to add 2 grid.mvc in the same page (with the same structure) and fitering, shorting and paging apply to both grids. I cannot to find proper documentation...but i have seen people uses ...
0
votes
1answer
62 views

Continue method executon without waiting for other method execution

I want to call a method inside some method and do not want the process to wait or take time on other method completion. like this public ActionResult Insert(int userId) { _userService.Insert(...
-6
votes
0answers
37 views

How to use one view with two actions at the same time in mvc [on hold]

Is it possible to have one view that shows data from two actions at the same time ? if possible can any one please show me how this is done . Thanks in advance for your help .
1
vote
3answers
38 views

AJAX calling different action on controller

AJAX method : $(".GetF").click(function (e) { e.preventDefault(); $.post('@Url.Action("test1", "flyer")', { "selectedIds": "1"}) .done(function (data) { ...
0
votes
1answer
13 views

DocuSign : DocuSign.eSign.dll after upgrading to 3.1.1.0 stop working for ApiClient.GetUserInfo

I have integrated docusign 3.0.1 with my c#.net project and its working fine but as we upgrade the docusign to 3.1.1.0 it start giving me the below error. {"Error while requesting server, received ...
0
votes
1answer
19 views

How can I create Property in domain class that won't be added in table when I run migration

I want to use Confirmpassword property in my domain class to check user enter correct password, But I think when I will run migration it will aslo create Confirmpassword column in table. How can i add ...
0
votes
3answers
71 views

Generic Attributes in MVC models

I created the GenericAttribute.cs file in my Models public class GenericAttributes<T> { public T Id { get; set; } public bool IsActive { get; set; } public DateTime CreatedDate { ...
-3
votes
0answers
27 views

Complex CRUD with Viewmodels [on hold]

In my Project , I have 2 models. one for Products and another one for Images. Product.cs : public class Product { public virtual int Id { get; set; } public virtual string PrpductName { get; ...
0
votes
1answer
42 views

Binding Radio Button to Angular in C# cshtml

I would like to pass the value of the Radio button along with the ng-click method in C#. How should I do that? I am binding the value of Resume into the Modal using JavaScript. I want to send the ...
0
votes
0answers
16 views

Identity server 4 with Asp.net MVC 5 application as a client single sign out

I have set up IdentityServer4 with 3 clients, two of them are in asp.net core and one is in MVC 5. All clients are using GrantType HybridAndClientCredentials. I have implemented backchannel logout in ...
0
votes
1answer
54 views

Call Web API from MVC Controller Hanging Up

I've tried many different approaches for the past couple of hours, but my method call is hanging up the thread. Here is my Web API code, which works fine when making AJAX call from the MVC client, ...
-1
votes
0answers
21 views

The instance of entity type 'BillingDetail' cannot be tracked because another instance with the same key value for {'Idno'} is already being tracked

I know this question ask many times but i tried alot but can't update record. I want to update/edit existing record but when i am trying to update i got error. InvalidOperationException: The ...
-4
votes
0answers
19 views

How to create Delete and Add feature [on hold]

I am following the MVC and already setup my connection string and got my initial loading of my table from mysql DB by following some online references. But I am struggling how to create the add and ...
1
vote
2answers
37 views

Why does Allowanonymous taking me to Account/ Login page

enter image description hereI am trying to redirect anonymous user to Account/newlogin page but it is keep redirecting to Account/Login page . [AllowAnonymous] public ActionResult ...
-1
votes
0answers
29 views

Cache for result of ActionResult

I am working on an ASP.Net MVC 5 project. I have two actions which execute one after another. First one is lightweight from server processing point, but has a lot of client-side processing. After it ...
-2
votes
1answer
30 views

Add search field asp.net [on hold]

I have a web app with a search field configured to search Last Names only. What do I need to do to update that search field with the ability to search fist names, email addresses, etc.?
0
votes
0answers
10 views

What would be the best approach to fetch mvc view content(text,image urls) from database and populate the view?

The requirement is such that the content shown on the view could be modified by an admin. To allow this, the content needs to be saved and fetched from database and populated to view. I also want ...
0
votes
1answer
41 views

What language/framework is most simiar to Salesforce development?

I hope it won't be marked as opinionated or too vague, but here's my quick story and question: I started my development adventure in ASP.NET WebForms, just to move to Salesforce (Apex + Visualforce) ...
0
votes
1answer
36 views

Server side paging & sorting and filtering Performance

I have only one table in database with 2 million records , i want the user to be able to browse the data and also have the ability to sort data and filter it. also user should be able to navigate ...