Questions tagged as 'asp.net-mvc'

2
answers

View Model should have related classes?

I have three entities: Manager , PersonalData and Address . A Manager has a PersonalData and a PersonalData has a Address . My question is when creating ViewModels , I would have to have a proper...
asked by 12.07.2016 / 23:15
3
answers

Scaffolding error during View generation

I'm creating a new project using EF Power Tools and I get the following error:    Error   There was an error running the selected code generator:   'A configuration for type' TST2.Models.Course 'has already been added.   To reference the ex...
asked by 24.11.2015 / 12:53
1
answer

ActionResult or JsonResult returning Json?

I see a lot of code in Controller where it is used as method ActionResult returning Json() , but I also see an approach using method JsonResult logically returning Json . Are there any differences between thes...
asked by 19.04.2018 / 17:12
2
answers

Problem with inheritance

I have a problem with a search in the bank, I will try to explain it in the best possible and clearest way. I have a Pessoa table and a Cliente table, the last one inherits from Pessoa , I also have a Unidade table a...
asked by 03.11.2016 / 13:11
2
answers

Doubt regarding Security, Authentication and Authorization

Hello, I'm having trouble building an architecture in the security-related part of the application. I need only logged-in and authorized users to have access to certain application functions. I know that I would normally use Roles-based authoriz...
asked by 19.07.2015 / 01:33
1
answer

GetEnumerator Error When Rendering a View

I did this just as a test: @model Operador.MVC.Models.OperadorModel @{ ViewBag.Title = "Operador"; } <table id="tblOperador" class="table table-hover table-striped" border="1" cellspacing="0" style="width: 100%;"> <thead>...
asked by 08.10.2015 / 18:29
1
answer

How to jump line with View Bag?

I have the following code public ActionResult Action1 { TempData["msg"] = "Essa parte primeiro.\n Essa parte na linha de baixo."; return RedirectToAction("Action2"); } public ActionResult Action2 { if (TempData["msg"] == null) { Te...
asked by 10.06.2015 / 15:59
1
answer

Reload page with MVC

I made a function in the model and the call in the controller. There, I move to jquery and the command to write to DB is successfully executed. It happens, that when I finish recording, the screen continues with the previous information, that is...
asked by 08.10.2014 / 14:15
1
answer

How to locate an image without informing the absolute path?

How to locate an image without entering the absolute path? Image img = System.Drawing.Image.FromFile("~/Content/images/SemFoto.jpg"); I tried in many ways and could not capture the image without telling the absolute path. The above line of...
asked by 03.11.2015 / 14:43
2
answers

Memory leak in XmlSerializer

I have the code below. Since the method is static and XmlSerializer does not implement Dispose , every method call, the system heaps in memory or GC garbage collector ) can clear this variable ? And in the case of c...
asked by 27.10.2015 / 17:21