Posts by Rod • 9,412 points
210 posts
-
0
votes1
answer128
viewsQ: controller responsibility
I have my Model Bank public class Banco { public int Id {get;set;} public string Nome {get;set;} } and my model Contabancaria public class ContaBancaria { public int Id{get;set;} public string Nome…
asp.net-mvc-5asked Rod 9,412 -
1
votes1
answer27
viewsA: Entity Framework removing entitdades that has fk
By default, the Entity framework comes with Cascade enabled, so I disabled it and it went on my Exception modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();…
entity-framework-6answered Rod 9,412 -
1
votes1
answer27
viewsQ: Entity Framework removing entitdades that has fk
I have in my Repospository, my method of deleting public virtual void Deletar(int Id) { var entity = _dbSet.Find(Id); _dbSet.Remove(entity); } The problem is that it is deleting even if it is with…
entity-framework-6asked Rod 9,412 -
2
votes1
answer490
viewsQ: How do I get an Annotation date, to be able to access value from another property?
I have my following properties: public ETipoPessoa TipoPessoa {get;set;} public string CnpjCPF {get;set;} public enum ETipoPessoa { Fisica, Juridica } I have this condition, if Type = Physical, I…
-
2
votes1
answer67
viewsQ: How to work with more than one dependency on Service class?
I have my class Service calling for GrupoService, in it are most of the shares that refer to a Grupo. Crud(Inserir,Alterar,Excluir,Listar) The only dependency I have in my class so far is the…
-
10
votes2
answers1641
viewsQ: Is it wrong to leave business rules on controllers?
I see in several code examples this, and even in the "standard" project that is created in visual studio, they leave a good part of the rule in the controller Is it wrong? When to use it? What is…
-
1
votes1
answer39
viewsQ: Lists do not load next to model
My model: public class Grupo: ModelBase { public Grupo() { this.Itens = new List<Item>(); } public Grupo(string nome): this() { this.Nome = nome; } public string Nome { get; set; } public…
-
2
votes1
answer44
viewsQ: How do I search multiple Checkbox fields?
I have several Checkbox <div class="checkbox"> <label> <input type="checkbox" class="chkItem" name="Selected" value="1" /> A </label> </div> <div…
-
0
votes2
answers982
viewsQ: How to redirect to another page when user does not have authorization
I have my Custom AuthorizeAttribute. It works perfectly the way I want, but it always directs the user to /Account/Login, I would like you to redirect to another page that I choose, since it has no…
-
7
votes2
answers3229
viewsQ: How to do this using @Renderbody from Asp.net MVC?
All screens in my system are Views and are rendered in @Renderbody in _Main layout I would like to change my layout and make it look like this: So, basically it’s like I explained in the image,…
asp.net-mvc-5asked Rod 9,412 -
2
votes1
answer665
viewsQ: How to set value for Jquery Datatables filter?
I have my input and button <input id="gridSearch" type="text" /> <button id="filter" class="btn btn-default">Buscar</button> and my table $.fn.dataTable.ext.legacy.ajax = true; var…
-
2
votes3
answers2284
viewsQ: How to disable Jquerydatatables auto search?
I am using Jquery Datatables, and need to remove the auto search that it has, leaving a "Search" button beside Someone’s already done it?
-
3
votes3
answers2912
viewsQ: Select in Entity framework with certain columns
I’m trying to make a select in a table that contains several columns and I want the command sql that the Entityframework gera contain only the columns I specified. My code is like this: var clientes…
entity-framework-6asked Rod 9,412 -
3
votes1
answer257
viewsQ: Manipulate String C#
I have strings that come so: "Cadastro,Novo" "Cadastro,Editar" "Cadastro,Excluir" "Cadastro,Morfar" "Cadastro,Etc" "Entidade,Novo" "Entidade,Editar" "Entidade,Excluir" "Entidade,Morfar"…
-
1
votes1
answer274
viewsQ: Url.Action outside the Area
I separated the user registration of Asp.net mvc into an area Area Control In a registration action, it sends the confirmation link, it is generated as follows var callbackUrl =…
-
0
votes1
answer115
viewsQ: How to do Logoff with Ajax?
I have my menu, and it has a dropdown <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Usuário</a> <ul class="dropdown-menu" role="menu">…
asp.net-mvc-5asked Rod 9,412 -
4
votes2
answers99
viewsQ: Menu in lower tab form
I wonder how to create a menu like this in a table row? Or what the name is for me to look up...…
javascriptasked Rod 9,412 -
2
votes1
answer1006
viewsQ: How to make a script run only once?
I’m using Asp.net MVC In my layout I have a menu div and I have the container div where my @RenderBody() And downstairs I have a script that pays for my menu: $(document).ready(function (e) {…
-
0
votes1
answer116
viewsQ: Usability of grid actions
When we talk about usability, we have N parameters. When we have records and the same may be numerous actions. What is the best way to treat these actions? Place actions on the grid line? with…
-
5
votes2
answers999
viewsQ: Bundle does not render css Asp.net mvc
I’ve got my own bill @Styles.Render("~/Content/css") And it just stopped working, it yields nothing The Bundle is being registered in the global.asax…
asp.net-mvc-5asked Rod 9,412 -
4
votes2
answers462
viewsQ: How to use HTML5 data- attributes with Asp.net MVC?
How to use attributes with " - " from Html5 and other plugins with the Html helper from Asp.net mvc?
asp.net-mvc-5asked Rod 9,412 -
1
votes1
answer61
viewsQ: Make more than one condition Annotation Asp.net mvc
I have my class and in it I have a property public TipoPessoa TipoPessoa {get;set;} The same is an enumerator that has value "Physical and Juridical" And I own a property that’s CNPJ or CPF public…
asp.net-mvc-5asked Rod 9,412 -
1
votes1
answer62
viewsQ: Pass fixed value to Repository
I have my Repository, with add method public virtual T Adiciona(T entity) { _dbSet.Add(entity); return entity; } Not if it’s possible, All my classes inherit from "Modelbase" public class ModelBase…
asp.net-mvc-5asked Rod 9,412 -
8
votes3
answers1099
viewsA: catching Description with Enumdropdownlistfor Asp.net mvc5
An alternative I found is to use Annotation [Display(Name = "Valor")] In it the Html Helper itself recognizes the values, not having to do anything more than that…
asp.net-mvc-5answered Rod 9,412 -
4
votes3
answers1099
viewsQ: catching Description with Enumdropdownlistfor Asp.net mvc5
How I get Description using the html helper Enumdropdownlistfor from Asp.net MVC 5 ? I have my enumerator public num Dias { [Description("Segunda dia de trabalho")] Segunda = 1,…
asp.net-mvc-5asked Rod 9,412 -
3
votes1
answer1314
viewsQ: What is and how does Claims work on Asp.Net Identity?
What is and how Claims works on Asp.Net Identity? In what real-use example would we use Claims? What is the advantage of using them? Sample codes?
asp.net-mvc-5asked Rod 9,412 -
0
votes1
answer2400
viewsQ: How to get the selected Row jquery datatables
have my grid: $.fn.dataTable.ext.legacy.ajax = true; var grid = $("#gridGrupo").dataTable({ "language": { "url": "/Scripts/Libs/DataTables/ptBr.txt" }, "processing": true, "serverSide": true,…
-
1
votes1
answer258
viewsQ: How to create subfolders for Api on Asp.net webapi?
By default, the folder is Controllers I would like to create other subfolders Controllers -> Api -> Othern/ Other2 etc How do I do this? and how do you configure the router for this?…
asp.net-web-apiasked Rod 9,412 -
1
votes1
answer279
viewsQ: How to do Reload Asp.net mvc pagedlist?
I have my grid with the html helper Pagedlist <div class="table-responsive"> <table class="table table-hover"> <tr> <th> @Html.ActionLink("Id", "Index", new { OrderBy =…
asp.net-mvc-5asked Rod 9,412 -
3
votes1
answer981
viewsQ: You can pass the roles without using [Authorize(Roles = "Role name")]
My system has dynamic roles("groups"), the user adding and putting users in. Also arrow that if it can insert, edit, delete, etc... With the use of Asp.net Identity Roles, he can do this…
-
3
votes2
answers372
viewsQ: return view with empty model
I do Ubmit to save, and I want it to return in the same view, but with empty fields, a new model, so it can add again But he always comes back with the data I filled out My action is like this:…
asp.net-mvc-5asked Rod 9,412 -
3
votes1
answer161
viewsQ: Preloader Asp.net MVC
How can I do a preloader(carrying...) while it is rendering the view on @RenderBody ? In search only found examples using Partial, but Views not Any idea?
asp.net-mvc-5asked Rod 9,412 -
1
votes1
answer3433
viewsQ: How to add a button in the columns in the datatable
I’m trying to add some buttons to the Datatable using columnDefs, but yet I can’t, and when I remove a few columns, it’s not aligned according to the order My current code is this: var grid =…
javascriptasked Rod 9,412 -
3
votes3
answers1185
viewsQ: icone does not stand next to input bootstrap
I’m trying to put an icon next to my input using bootstrap, but it always stays down My code is like this: <div class="row"> <div class="col-md-12"> <div class="form-group has-warning…
-
0
votes1
answer414
viewsQ: Refresh on page when giving resize
I have my function to resize, function resizeGrid() { $(".divGrid").css("height", ($(document).height() - 325) + "px"); } $(resizeGrid); It works as I’d like, but when testing in the browser, I…
-
4
votes3
answers1517
viewsQ: How to use Skip and Take with Pagedlist Helper
I would like to make the pagination, but using Skip and Take on my LINQ not to fetch all results. Currently my code is like this: public ViewResult Index(int? page) { var grupos= from s in db.grupos…
-
3
votes2
answers379
viewsQ: Json format on return
I need to pass a json with the following format: {rows:[ { data:[ "1", "Nome teste", "Descricao teste"] }]} But when using my jsonresult action, I don’t know how to return this way public JsonResult…
asp.net-mvc-5asked Rod 9,412 -
1
votes1
answer472
viewsQ: Validate without post with html helper Asp.net mvc
How do I validate using Html helper and data Annotation, but without giving post I mean, ex: Stringlength(10) While he is typing, go validating this annotation...(among others)
asp.net-mvc-5asked Rod 9,412 -
6
votes1
answer7712
viewsQ: How to use Angular UI Router? and what are the advantages?
How to use Angular UI Router? and what are the advantages ? What are the long-term advantages of using it and not the standard of Angularjs?
-
0
votes1
answer317
viewsQ: Expression does not work in Include in Entity Framework
I tried to make the following expression var listag = db.grupo.Include(x => x.Itens).ToList(); It doesn’t work that way, but if I pass that way: db.grupo.Include("Itens").ToList();, So it works,…
entity-framework-6asked Rod 9,412 -
0
votes1
answer989
viewsQ: What is the difference between form-group and input-group bootstrap?
What is the difference? in which cases are used one or the other?
-
5
votes1
answer241
viewsQ: Lock files in Asp.net mvc folder
I have a folder named "app" I want to block access to all files if the user is not logged in. tried so: <location path="app"> <system.web> <authorization> <deny users="?"/>…
asp.net-mvc-5asked Rod 9,412 -
3
votes1
answer6100
viewsQ: What is the right way to use form-group bootstrap?
Which Correct Way to Use Form Group ? I use it as follows <div class="row"> <div class="col-md-2" align="center"> <span class="glyphicon glyphicon-user"…
-
3
votes3
answers109
viewsQ: How to test Entity Framework performance?
I want to create mapping with heritage Person -> Customers, etc But I would like to test performance with the 3 types of mapping( TPH,TPT,TPC) How do I do it? Someone has had the experience to…
-
2
votes1
answer136
viewsQ: Authentication, email / password and knowing which bank is correct
The idea is a Saas application. Where there will be only 1 single deploy. and customers will be separated by bank Once this is done, there will be a login screen, where login(email)/password is…
-
5
votes1
answer841
viewsQ: Problem Dropdown menu bootstrap
I have my dropdown menu But I always have to give 2 clicks for him to open the menu, I would like on the first click it already opens... You could have had him without the element <a? that’s my…
-
1
votes3
answers998
viewsQ: How to work with multiple bootstrap columns,
In bootstrap 3, there are some types of columns col-Md-xx , col-Sm-xx, col-lg-xx My question is, is there any pattern to be easy to develop with all these columns? For example "Whenever using…
-
7
votes2
answers1242
viewsQ: How to organize the codes in Angularjs?
I have several modules with Angularjs angular.module('modulo1', ['ngTable']); angular.module('modulo2', ['ngTable']); angular.module('modulo3', ['ngTable']); window.app = angular.module("app",…
-
4
votes1
answer121
viewsQ: Performance to Render ASP.NET MVC Pages
How can I have greater performance to render my pages using ASP.NET MVC ?
-
0
votes1
answer886
viewsQ: Enable/Disable Angularjs buttons with values coming from the api
I have my following screen : The side menu comes from an Api List with user permissions have my classes: public class Menu { public int Id {get;set;} public string Nome {get;set;} } public class…