Posts by Rod • 9,412 points
210 posts
-
3
votes3
answers877
viewsA: Asp.net serving statics files
You inform the ISS that every request must go through it. IIS does not apply permission on static files. In his Web.config put the following code: <configuration> ... <system.webServer>…
-
4
votes1
answer147
viewsQ: How to show the build version?
I see in some pages and systems the compilation version. I’d like to show in a view the compilation version of my ASP.NET MVC project.
-
5
votes3
answers4561
viewsQ: Validate Datetime on the client
I have a model with a property like DateTime: [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")] [DataType(DataType.Date, ErrorMessage="Data em formato inválido")]…
-
1
votes1
answer185
viewsQ: Use Jquery Autocomplete in Id properties
I have my Model as follows public class Album { public int Id {get;set;} public int ArtistaId {get;set;} } public class Artista { public int Id {get;set;} } And in my view, I use:…
-
8
votes1
answer2897
viewsQ: What is Bind(Include = "Property") used for?
By creating a CRUD with scalfold in ASP.NET MVC, in POST, we have the following code: public ActionResult Create([Bind(Include = "Id,Nome")] Grupo grupo) {...} What’s this one used for [Bind]? When…
-
0
votes1
answer135
viewsQ: Query with Pagedlist
I am using Pagedlist.Mvc for results pagination. But when doing the following action with the querys: public ActionResult Index(int? page, string searchString) { int pageSize = 10; int pageNumber =…
-
1
votes2
answers196
viewsA: Doubt cache Asp.net MVC
@Hermes First, it will depend on the amount of records you are sending. You can async call with the Entity Framework One of the ways to load more "fast" your home, is you load your views async with…
-
2
votes1
answer114
viewsQ: How to register new in autocomplete
I don’t know if this is the right place to ask, but I always see the following component in some systems: I would like to know, which plugin is this? If it is just jquery ui autocomplete, how is…
-
2
votes2
answers601
viewsQ: Master Detail with Select2
I’m trying to make a master Detail One of its inputs is a Select2, But it does not generate the Select2, until why it is generated only when finished reading the script, and the second way I did,…
-
4
votes1
answer703
viewsQ: Validate if one of the fields has been completed
I’m using the plugin Jquery Validation I need to know if at least one of the fields has been filled in Fields> Phone, Mobile Phone I tried to do so: $("#Telefone").rules("add", { required:…
-
1
votes0
answers64
viewsQ: Miniprofiler error Asp.net mvc 5
I’m trying to use the Mini-profiler I made the following configuration: PM> Install-Package MiniProfiler PM> Install-Package MiniProfiler.MVC4 (According to the Doc also attends the MVC5)…
asp.net-mvc-5asked Rod 9,412 -
4
votes1
answer1435
viewsQ: What encryption is used by Asp.net Identity?
When we create a user using Asp.net Identity, it generates a Hash, even there is a column in the database named Passwordhash My question is, what kind of Hash is generated ? What encryption does…
-
20
votes3
answers8663
viewsQ: What is the difference between DOM and virtual DOM?
I saw a framework that worked with Virtual DOM and thus became faster than the others. (framework : facebook reactjs) What is the advantage and disadvantage in each one? How to work with each one?…
javascriptasked Rod 9,412 -
3
votes2
answers103
viewsQ: How to capture Assembly from classes that inherit from a single class
I have numerous classes. All inherit from a single class public abstract class ClasseBase { public int Id {get;set;} } and other classes: public class Teste1 : ClasseBase{ } public class Teste2 :…
-
3
votes4
answers164
viewsQ: Father class with the same responsibility of the daughter class
I got my class Item public class Item { public string Nome {get;set;} public decimal Valor {get;set;} public ICollection<SubItem> SubItens {get;set;} } public class SubItem { public string…
-
3
votes2
answers670
viewsQ: What is the difference of loading javascript in <script> or external file?
What is the difference of loading javascript in or external file . js? <script> Código aqui </script> ou <script src="caminho"> </script> Is there a difference in…
javascriptasked Rod 9,412 -
1
votes2
answers1393
viewsQ: Alternative to Session
I am using Session to store the company object the user is logged in to. Use also to make filters, for it view only what is from the logged-in company. However, I am with the following problems: 1 -…
-
2
votes1
answer150
viewsQ: Error using Jquery UI and Bootstrap
I’m using Draggable jquery UI What happens is, when I put the element inside Div’s contents, I can’t get it out anymore And just remove the css from Bootstrap it works. Follows the Jsfiddle…
-
1
votes1
answer2767
viewsQ: How to validate input file with jquery validation?
I’m trying to validate a input of the kind file with Jquery Validation. Following the documentation, I do the following: My input: <input class="form-control" id="ImagemUpload"…
-
1
votes1
answer124
viewsQ: Navigation using @Renderbody
When we use @RenderBody, the other pages used with _Layout, is rendered only in there, correct? My question is: Assuming all our pages use the _Layout what’s that @RenderBody When browsing, it only…
asp.net-mvc-5asked Rod 9,412 -
18
votes2
answers1120
viewsQ: What is the use and when to use version in . js and . css files?
What it’s for and when to use js? v=123(example) css file? v=123(example) What benefits and how the browser interprets this
-
0
votes1
answer71
viewsQ: Edit registered containing image
I have my model: public class Produto { public int Id {get;set;} public string Nome {get;set;} public byte[] Imagem {get;set;} } How do I handle it if it is "Removing" or is Editing(Replacing) the…
asp.net-mvc-5asked Rod 9,412 -
4
votes2
answers92
viewsQ: Setar schema in query with Repository
I have my Repository: public class RepositoryBase<T> where T : class { protected AppDbContext _context; protected IDbSet<T> _dbSet; public RepositoryBase() { _context = _context ?? new…
-
1
votes1
answer968
viewsQ: How to capture file size from System.Drawing.Image?
I have a method to which I pass the parameter System.Drawing.Image and the percentage that this image will get after the resize. public static Image ResizeImagem(Image imgFoto, int percentual) {…
-
8
votes2
answers925
views -
16
votes3
answers4284
viewsQ: What is the probability of generating a Repeated Guid?
What is the probability of generating a Repeated Guid with Guid.NewGuid()? I am uploading numerous images from my system. The same will be a Multitenancy, and will share the same Deploy, from the…
-
1
votes1
answer286
viewsQ: How to remove querystring Returnurl?
How to remove querystring Returnurl from my Login page ?
asp.net-mvc-5asked Rod 9,412 -
3
votes2
answers1016
views -
0
votes1
answer335
viewsQ: Script does not appear when pressing Section
I have a Section called Scripts (the one configured by default): @RenderSection("scripts", required: false) And I’m trying to load the Tinymce Plugin as follows: @section Scripts { <script…
-
2
votes1
answer64
viewsQ: Problem with Html.Partial and Viewbag
I have my following controller: public ActionResult Index2(int Id= 0) { if (Id == 0) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } ViewBag.ClienteId = Id; return View(); } public…
asp.net-mvcasked Rod 9,412 -
1
votes1
answer2860
viewsQ: How to remove URL after upload?
I have my URL www.site.com/product/link/code/1 After loading, I would like the URL not to appear in the browser, just www.site.com How can I do that?
-
-1
votes1
answer133
viewsQ: Does Try Catch influence performance?
Utilise Try...Catch influence on performance? in memory usage? Would be a problem if all actions you do have error handling? try { clienteRepository.Salvar(entity); } catch (Exception e) {…
-
1
votes1
answer304
viewsQ: What better way to leave a value in session?
What better way to leave a session value on Asp.net mvc ? This value, can be changed by the user, when he wants, but as you use the system, will use the value of that session... For example: Set a…
asp.net-mvc-5asked Rod 9,412 -
2
votes1
answer53
viewsQ: Can I edit my router at runtime?
I have the route of my area context.MapRoute( "Cadastro_default", "{Empresa}/Cadastro/{controller}/{action}/{id}", new { empresa = Empresa.GetEmpresa(), action = "Index", id = UrlParameter.Optional…
asp.net-mvc-5asked Rod 9,412 -
2
votes1
answer180
viewsQ: Is it wrong to leave a FK inside the table that gives rise to PK?
It’s wrong to do this on a bank table? Let me quote an example: We have the Customer: Google And in it we have the unit: Google Brasil Then we have the following example table: Table Client Id |…
-
1
votes1
answer51
viewsQ: What is the Order= parameter in the Authorize attribute?
What is the parameter Order in the Attribute AuthorizeAttribute of Authorization of Asp.NET? How to use it ?
asp.net-mvc-5asked Rod 9,412 -
3
votes1
answer158
viewsQ: Multitenancy with Entity Framework
I have my application, which shares the same database with all my customers. Separating them only by a column of the table Empresa_Id, all my actions, Save, List, Edit, Delete are done by my…
-
3
votes1
answer824
viewsQ: Audit with Entity Framework
I am wanting to do the audit tables of my entities. At first I thought to overwrite the method SaveChanges. I also thought of writing a method that will be doing the audit on my repository base.…
-
2
votes3
answers2284
viewsA: How to disable Jquerydatatables auto search?
Removal of search and other inputs from Jquery Datatables is done through the dom attribute I solved my problem using this: "dom": '<"top">rt<"bottom"ip><"clear">' It only removes…
-
2
votes3
answers2912
viewsA: Select in Entity framework with certain columns
The problem is when using Ienumerable The same causes you to search all fields and records, ignoring the LINQ or Lambda methods of the Entity Framework. To circumvent this, one must use Iqueryable…
entity-framework-6answered Rod 9,412 -
7
votes1
answer7986
viewsQ: How to make return with Ajax Beginform
I have my Form with the following statement: @using (Ajax.BeginForm("Novo","Cliente", new AjaxOptions { OnSuccess = "OnSuccess", OnFailure = "OnFailure" })) { } My duties in the js: function…
asp.net-mvcasked Rod 9,412 -
0
votes2
answers801
viewsA: Bootstrap Accordion does not work when loading content with ajax
In research, I saw that it is because of the lib Collapse.js that bootstrap uses. It does not get support for this. One way to resolve, is to click on accordion.
-
4
votes1
answer204
viewsQ: How to make editable template in ASP.Net MVC?
I see in many systems, (e-commerce mainly) the possibility of editing the system template by changing the CSS and HTML documents. There is some engine or similar in Asp.net MVC? These codes (CSS,…
asp.net-mvc-5asked Rod 9,412 -
1
votes2
answers153
viewsQ: View condition does not work
I’m checking if my Viewbag comes something So I’ll tell you what: @if (ViewBag.Itens != null) { foreach (var item in ViewBag.Itens) { <div class="col-md-6"> <div class="checkbox">…
asp.net-mvc-5asked Rod 9,412 -
1
votes1
answer114
viewsQ: How to pass multiple viewmodel to a single view?
I have my view, it depends on a viewmodel. But in this same view, I add items referring to the main one with a bootstrap modal, and in it I need another viewmodel for validations. How I pass 2…
asp.net-mvc-5asked Rod 9,412 -
-1
votes2
answers801
viewsQ: Bootstrap Accordion does not work when loading content with ajax
I have my acordion, inside his body, I have a div where the content is loaded via ajax <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div…
-
4
votes3
answers1368
viewsQ: What better way to save a Group object that has Items lists?
I have a record and in it there are several links, for example: public class Grupo { public string Nome {get;set;} public List<GrupoItemA> ItensA {get;set;} public List<GrupoItemB>…
-
1
votes0
answers108
viewsQ: Why does my Asp.net mvc tables have pk duplicated user?
I am using Asp.net Identity for authentication and authorization I have my user class: public class Usuario : IdentityUser<int, ApplicationUserLogin,ApplicationUserRole, ApplicationUserClaim>…
-
15
votes6
answers21826
viewsQ: How to remove auto-fill inputs?
I have my email input/password. But always when typing an email that I have already saved login/password, the browser automatically fills in my form. How to solve?
-
3
votes1
answer1420
viewsQ: Jquery validate does not validate correctly
I am using Jquery validate and unobtrusive for validation in an Asp.net mvc 5 project When I needed to work with decimal numbers, in search I found this Link where it has the validations and etc.…