Newest 'asp.net-mvc' Questions

Q&A for professional and enthusiast programmers

Text Box typing issue in mvc 5

I have text field with model binding value , it is a decimal field and when I try to edit the before decimal point , when I type second number,third number is displaying (which is first number) ...

Is it possible to redirect request from middleware in .net core

What I'm trying to achieve is this: When someone visits: smartphone.webshop.nl/home/index I want to redirect this from middleware to: webshop.nl/smartphone/home/index I want to do this because I want ...

What will be next learning path after working 2 years in .net windows form and core java to switch job [on hold]

There are no any jobs for windows form experience. I have some experience on core java. But don't have any experience in database. What will be next learning step to switch job. Can i switch job in ...

asp mvc application users linq to join to other tables

I am using default asp.mvc5 users identity to store and manage users in my database. I have other db tables that will be referencing the users table. The problem i am facing is how to extract user ...

Make javascript checker on where clause [on hold]

In our website we enable admin to write where clause like 'EmpId = 25 and DeptId = 13' in a textbox so the related page will display data based on this filter. i need to make javascript checker to ...

SQLCommand update query in batches

I have written a code like following: for (int i = 0; i < ListToUpdate.Count; i = i + 500) { SqlCommand command = new SqlCommand(); command.Connection = new SqlConnection("Data Source=.;...

Is It Possible to Call Mvc Controller From Web Api Controller?

I have a Web Api This Api Receive a Digit From hardware On the base of that value i have to refresh my Mvc View. How I can Achieve this ?

Jquery datatable fail to get selectd rows after paging [on hold]

I am using jquery datatable in MVC application. I have added one checkbox column to the table for deleting items. When I checked rows and delete. Data table didn't give correct no of selected rows.

Solution for javascript window.close()?

I have been searching online to peform window.close() using the javascript. I have a MVC application,when i click on logoff button the page should close. I know that the window.close is not working ...

How do I return results for one day?

I am trying to create a sales report where the User can select a daterange and get back a sum of sales and a datetime for each day. I've made a method that takes two datetimes - StartDate and EndDate ...

ASP.NET MVC 5 IdentityUsers has Post. How can I assign posts to user?

I want to create something like a blog application. User signs in and can add a post. This post is assigned to him (there is a relation one to many). The post can have comments. I am using scaffold to ...

sqlexception was unhandled by user code? asp.net MVC

i'm trying to create localDB in visual studio 2015 however when i run any code associated with DB i get sqlexception public ActionResult Index() { Student x = new Student { FirstMidName = ...

ASP MVC Rotativa (wkhtmltopdf) to Virtual Directory

I don't want to raise this as an issue / bug on the git page as I imagine I am simply using the package wrong. I have an ASP MVC site running on IIS10. Actual folder structure is: x:/ library/ &...

Currency Format Failing on View Component - Work Arounds?

I have searched a lot. Perhaps I am looking in the wrong places... I have a product list and cost price within the product list. An extract from the Model: [Display(Name = "Cost Price")] [...

Power BI : System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in

We are facing following error when deployed project in IIS, And it is working fine when ran from visual studio. Error at when calling below method to get AccessToken return authContext.AcquireToken(...

It's possible to achieve roles based access without using OAuth token?

I'm Developing .net core application which using Role Based authentication capabilities from OAUTH, Which internally needs token generated by OAUTH during login, But in my situation the login token is ...

Dynamic Positioning of Data Fields in crystal report 13 update 18

I am using crystal report vs13 update 18.i have to set fields(columns) of report dynamically..i have found one solution here Blog But crystal report version 13 there is no option to select Size and ...

Cookie expires after a couple of mins? Timeout not working properly

I have code like this in Login Controller. I create a cookie and sessions when the user login with the correct username and password. Models.DTO.Security.CustomPrincipalSerializeModel serializeModel =...

How do I Pass Asp.Net MVC ViewData to vue.js data object

I am using vue.js in lieu of Asp.Net MVC templating and below is the code. @model Manage.Models.Commands.Category.UpdateCategoryViewModel `@using (Html.BeginForm("Update", "Category", FormMethod....

How do I manage the per web request scoping for an Asp.Net Core app when I share Ninject modules that are already used by several other apps?

I have a bigger consisting of shared libraries and different host applications. For now I have bindings like: Bind<IUserService>().To<AspNetUserService>().InScope(RequestScope); Or: ...

Form submission refreshes page instead of redirecting

I have the following form in my ReceivingController Index.cshtml view: @using (Html.BeginForm("Details", "Grv")) { @Html.TextBox("grvNumber") <input type="submit" value="search" /> } ...

MVC controller with void method without JavaScript

Is there a way to call void method in MVC controller without returning blanck page with address controller/voidmethod and without using JavaScript. For example on a page clicking a button to fill a ...

Approach to start building front-end of new CMS in .NET Core MVC with Entity Framework

I am going to start building the base of a new CMS; only the front-end with a database so far. I want to be able to have a main page, where i can create child nodes to this page, which should be ...

Change resource file texts in web frontend

I have a MVC application and It should be able to handle multiple languages. My need is to make resource texts for each language editable in the web frontend.

Entity Framework Cannot Open Database Requested By the Login - The Login Failed For User

I've just uploaded my website to a server and getting an error called "cannot open database requested by the login the login failed login failed for user". In my global.asax file on Application_Start ...

MVC WebAPI slow when sending “big” Data with jquerymvcformurlencodedformatter.

I am using a mvc Application with WebApi to send Data to the Server. When sending "big" data request about 30k chars it takes 1-2 minutes to send it to my Server. After Tracing my WebApi Call, it ...

Getting error from server and show it on client

In a form built with html and javascript how can I send value to server and if the value is incorrect then get validation error from server and send them to client(show in form). I am using asp.net ...

How can I assign two call back paths to an OWIN middleware

I have developed an OWIN middleware to enable user authentication with an external authentication provider, which in this case is ADFS 3.0 (using OAuth 2.0). The call back path for this middleware is ...

convert a jpg/png/txt or any file format to pdf using mvc5

How do i convert a jpg/png/txt or any file format to pdf using mvc c#. Here is the code: public ActionResult SaveProfileDocument(string code) { bool isSavedSuccessfully = true; ...

MVC code does not calling API method

MVC controller method public async Task<ActionResult> GetCJTDLitigantCases(string searchKey) { var requestUri = cjtdkioskhearingsURI + "?searchKey=" + Server.UrlEncode(searchKey)...

ASP.NET MVC form won't submit in IE

I have an issue submitting a form using internet explorer or edge. The form submits fine in both Chrome and Firefox. The problem appears to be coming from the OpenIdConnect authorisation flow but I'm ...

jquery error $(…).dialog is not a function in MVC5 page

I am trying to implement a jquery dialog based on a serverside check. I get error saying $(...).dialog is not a function. I have referenced the important jquery files . The logic for the serverside ...

Don't generate blocks without values (ASP.NET MVC)

I have back-end code here is code [HttpGet] public ActionResult QuestionBlocks() { var _id = TempData["ID"]; var questBlock = db.QuestionBlocks .Where(x => x....

Managing state in asp.net mvc C#

On loading the application, table with list of items is displayed. On clicking the save button, i want to write the list of items to excel. When i click the save button, in the new request send to ...

Read/Modify response of MVC Action with filters

I have an HttpPost action as below: [HttpPost] public string GetPerson() { string output = GetPerson(); return output; } I am returning xml as a string. Is it possible read this string in ...

how to get json data from external rest full web service in asp.net mvc 4

I am trying to get the json data from an external rest url(http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3) and display it on my web page in my asp.net mvc application. ...

unable to call log off method in asp.net core

I use this code to logout from dropdownmenu but didn't work <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>

https on default ASP.NET MVC

I have ASP.NET MVC web app. When I upload it on azure web app, web site has http:// I need it to be https:// always. How I can do this? I know that it may be too broad question, but can you give ...

MVC Submit ID as Parent_ID

I've generated a partial view in VS and I'm trying to add a child item to certain parent on command. The question is how can I forbid to change Parent_ID and put an ID of an element that's comming ...

Comparing two lists by specific criteria and updating/inserting records for the matched criteria

I have written a code/database design where I have following classes mapped in my application: public class Items { public int ItemsId {get;set;} // suppose this is the PK in my table public string ...

Mvc 5 The compiler failed with error code -2146232576 [on hold]

I am having problems my project publish to server with ftp Description: The compiler failed with error code -2146232576.

MVC4 razor text area control update asynchronously

I am new to MVC programming. I designed a JSON generator with xml files as input. Index.cshtml @model Ramco.Plf.UiGenerator.Mvc.Models.Home @{ ViewBag.Title = "Ui Generator"; } <h2>Ext ...

mvc dropdownlist save data but not showing selected value

mvc dropdownlist not showing selected value but save data...I tested in firefox, chorme, edge all have the same problem..... <div class="form-group"> <label asp-for="@Model.Genre"><...

No response when using client library from asp.net mvc to get content from sense/net

I'm trying to call sensenet api to get content using client library from asp.net mvc(asp.net mvc app and sensenet are two different app), no response and no error. But using same code in console ...

X509Store Certificates.Find() intermittently failing to find certificate

I have a problem with an MVC web app which calls to another service using a private certificate. The certificate is in my Personal keystore against the current machine- I have used winhttpcertcfg to ...

Set Encrypted connection in web.config during wix installation

I have got a web application which is using base 64 encrypted connection string. <add name="connString" connectionString="r5IJ/jyd79T65xiCQ5c6m2vj6B9rVjFMfYiOW7WcpDDVZNJcQGDJfaO6kYfNCvlGXYthl+...

Knockout counter error (ASP.NET MVC)

I have script written via Knockout JS. Here is view code <span data-bind='text: numberOfClicks'>&nbsp;</span>/<span data-bind='text: totalnumberofClicks'>&nbsp;</span&...

Unable to save details to db.AspNetUsers: Unable to create or track… because it has a null primary or alternate key value?

For some reason my code won't update or save changed details to the database. Any ideas? The error I'm receving is: An unhandled exception occurred while processing the request. ...

MVC passing data to partial view with jQuery

I have view with button, and when the button is clicked partial view is loaded.(see code below), in some reason my .load function passes the object but Name is null and Id is 0 My View controller ...

what are the best and the easiest javascript charts libraries to use with asp.net using vb.net

what are the best and the easiest javascript charts libraries to use with asp.net using vb.net ?
Translating... 0%