Questions tagged as 'asp.net-mvc'

1
answer

InvalidOperationException: Can not create a DbSet for 'ApplicationUser' because this type is not included in the model for the context

I already have a database created in Sql Server, then I execute command: PM> Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Teste;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entities After the...
asked by 05.08.2017 / 22:10
0
answers

Dynamic LINQ from DTO - DateTime filtering

I'm trying to mount a dynamic filter from a DTOFilter object that I get populated through the View. My problem is, when I try to filter the results that will be shown on the screen by MesAno, I can not properly handle the data so that LinqToEnti...
asked by 10.08.2017 / 22:09
0
answers

Get route.name through HttpContextBase

I have mapped routes in my application: context.MapRoute("Home.Index", "home/{action}/{parameter}", new { controller = "Home", action = "Index", parameter = UrlParameter.Optional }); I wrote an attribute that inherits from: Auth...
asked by 31.07.2017 / 20:40
1
answer

RedirectToAction in JavaScript does not work

After a validation I call the controller in the action (Add) to add a new record through javascript. If the insertion succeeds I give RedirectToAction to the index of this same controller passing the id of the profile that I just regis...
asked by 31.07.2017 / 15:32
1
answer

How do I know if a Json request returned no result?

I have a code in JavaScript that searches a database and fills a input with the name of the patient found: $("#bCns").keypress(function (e) { if (e.which == 13) { var options = {}; options.url = "/Home/pegaPac...
asked by 29.07.2017 / 21:40
1
answer

Calling a text / x-kendo-template script from a javascript function

I have this new button and in the onclick event I am calling the openEditor() function, and inside of this function I want to call a script of type text/x-kendo-template . How can I do this? My code currently: Custom...
asked by 14.07.2017 / 15:52
1
answer

Bootstrap Modal change and Ajax ASP.NET?

I developed a basic functionality in the ASP.NET MVC controller where I have a product list and it changes in the Back-End and in the front-end I use Bootstrap-Modal to load the product and change, the modal loads the product perfectly , the pro...
asked by 12.07.2017 / 17:41
0
answers

ValidateAntiForgeryToken + Back button

Good morning. I have a login form on a webpage using MVC 5, I am using the [ValidateAntiForgeryToken] function to validate forms for security reasons. The page logs in correctly, however when clicking the Back button of the browser and ent...
asked by 05.07.2017 / 14:38
3
answers

LinkButton: Open link in a new window (Right-click)

I would like to know if there is any way I can open a new tab by right-clicking or a middle mouse button ... I am using " LinkButton " but the command occurs within OnItemCommand="ListaMenu_ItemCommand ". Aspx: <asp:Repeater...
asked by 17.07.2017 / 16:12
1
answer

Google API Do not show up on my page

Hello, I'm trying to insert google maps into a MVC site that Visual Studio 2012 already makes available for testing. By taking only the maps part and putting it in a aspx , it generates the cute map the way I ne...
asked by 18.07.2017 / 14:28