Posts by Leonel Sanches da Silva • 88,623 points
2,010 posts
-
3
votes1
answer2742
viewsA: Disable <Asp:Button after being clicked
Is that the event of button_Click cannot interfere with button behavior, so it has to be another event to modify this button. Put in the Page_Load of your Code Behind the following:…
-
1
votes1
answer331
viewsA: Add Textbox inside an HTML table with Jquery
I think you mean width, nay size <script type="text/javascript"> $('#pesquisar').click(function () { $.ajax({ url: "/RCM/ListarMateriais", type: "POST", data: { nome: $('#NomeMaterial').val()…
-
1
votes1
answer161
viewsA: Preloader Asp.net MVC
It’s not much of a secret: Controller public JsonResult MinhaAction(int id) { // Preenchimento de 'meuJson', e tal return Json(meuJson); } View I’m using jQuery, and supposing you’ve already found a…
asp.net-mvc-5answered Leonel Sanches da Silva 88,623 -
1
votes1
answer3433
viewsA: How to add a button in the columns in the datatable
I think the approach should be a little different. The example I found configure the column as follows: <script type="text/javascript" charset="utf-8"> $(document).ready(function() {…
javascriptanswered Leonel Sanches da Silva 88,623 -
2
votes1
answer450
viewsA: Change URL Ajax Partialview Request
The best way to do this is to implement Actions that only answer Ajax. For this, implement an attribute that only responds Ajax, more or less like this: public class AjaxOnlyAttribute :…
-
8
votes1
answer271
viewsA: Integration with GIT
Has: https://github.com/libgit2/libgit2sharp By the way, it also has Nuget package, if your solution uses packages: https://www.nuget.org/packages/LibGit2Sharp…
-
6
votes2
answers8672
viewsA: Asp.net Webforms. Timeout error exceeded in SQL Server. How to resolve?
Possibly the Pool is too short. Add the following to your Connection String: Min Pool Size=5;Max Pool Size=250; Connect Timeout=3 This ensures that the executed connections will not be closed before…
-
0
votes1
answer52
viewsA: Dependency on services
I think the idea of doing another service updating the stock can unnecessarily complicate the solution, unless the new method AtualizaEstoque is used by other parts of its code, but separation is…
-
1
votes2
answers9397
viewsA: Place image in bootstrap menu
Thus: <div class="container"> <div class="navbar-header"> <a class="navbar-brand pull-right"><img src="~/Images/ache.jpg" /></a> ...…
-
1
votes3
answers637
viewsA: Alternative to the Enterprise Architect
Use the Visual Paradigm, that has installation for Linux. It is the most complete UML tool I know. Has Community and Pro version.…
software-engineeringanswered Leonel Sanches da Silva 88,623 -
2
votes1
answer85
viewsA: Model in sessions
Has several drawbacks. In this link, for example, the author teaches how to easily capture data from a session. By putting his Produto within a Session, you lose lazy load capacity because the…
-
5
votes2
answers140
viewsA: Jquery text editing component
Tinymce is one of the most famous: http://www.tinymce.com/ The most complete I believe is the Ckeditor: http://ckeditor.com/ There’s also Aloha, but I’ve never used that: http://aloha-editor.org/…
-
1
votes2
answers384
viewsA: Create menu type, but with (+) sign (Treeview)
Are there any components for this? It is possible to do it in ASP.NET and MVC? Yes, it calls Easyui. As you are working on top of ASP.NET MVC, it is available as a Nuget package:…
-
2
votes1
answer793
viewsA: Lambda Linq Problem: LINQ to Entities does not recognize... get_Item(Int32). How to resolve?
The Include awaits an object complex related to your Model: http://msdn.microsoft.com/en-us/library/gg696785(v=vs.113). aspx Therefore, what causes the problem is not the Include, and yes the Count,…
-
2
votes2
answers124
viewsA: How I give a Sort on my dropdownlist
Extending the @Diegozanardo response using the HtmlHelper of Razor: @Html.DropDownListFor(model => model.CodTipo, new List<SelectListItem> { new SelectListItem { Value = "AC", Text="ACRE"},…
-
2
votes2
answers1514
viewsA: View Razor to PDF
Two options: Razorpdf2 (package of my own, supports all documents of the old Razorpdf + iTextSharp 5 package): https://www.nuget.org/packages/RazorPDF2/ Receives as input an HTML View using the…
-
3
votes1
answer241
viewsA: Lock files in Asp.net mvc folder
It remains to warn the IIS that any and all requests (including static files) must be processed by it. The way it was before, the OSI doesn’t apply the FormsAuthentication about static files. Put it…
asp.net-mvc-5answered Leonel Sanches da Silva 88,623 -
3
votes2
answers576
viewsA: How to create 1-N class relationships with more than one property and even subtype?
The problem has not so much to do with class derivation as the fact that you have two ICollection the same base type (in this case, Galho). This creates some ambiguity when the Entity Framework…
-
2
votes1
answer317
viewsA: Expression does not work in Include in Entity Framework
The implementation of Include() using a delegate type is in the namespace System.Data.Entity for the Entity Framework case, or System.Linq, if you were using Linq, which is not your case. As pointed…
entity-framework-6answered Leonel Sanches da Silva 88,623 -
2
votes1
answer384
viewsQ: Configuring Cakephp with Composer
I installed Cakephp on a MAMP (Mac OS X) server and configured the cakephp-upload plugin there was the hint of installing the plugin using the Composer. I set up my composer.json as follows: {…
-
3
votes2
answers1137
viewsA: Standards for user authorization/permission
By Microsoft, there are basically 3 ways to design standard for permissions: Por Roles; Por Claims; By some other standard implemented by the user…
-
3
votes1
answer654
viewsA: Insert data into Active Directory via SQL SERVER
Warning: As combined with the questioner, this answer is not intended to answer exactly what has been requested, but to provide alternatives for handling Active Directory data using other languages…
-
1
votes1
answer526
viewsA: Iqueryable select data from multiple tables
I don’t quite understand this part here: var model = _service.List()... But I suppose it should be a context call, since you put that code works in Entity Framework. The command in theory is…
-
2
votes1
answer1261
viewsA: Map associative tables in the Entity
Map manual. For example: public class Usuario { [Key] public int UsuarioId {get;set;} [Required] public String Nome {get;set;} ... public virtual ICollection<UsuarioCargo> UsuarioCargos…
-
4
votes2
answers856
viewsA: How to change the default package installation directories by Nuget?
Not. The destination configuration of the files is defined by the package, and usually follows a pattern not to become a mess. What you can do, as @viniciushana says, is create your own packages…
visual-studio-2013answered Leonel Sanches da Silva 88,623 -
1
votes1
answer205
viewsA: Web API - How to validate the model from Dataannotation.Remote()?
Write down your method with [HttpPost]: [HttpPost] public JsonResult<bool> LoginUnico(string login) { return Json(false); }
asp.net-mvcanswered Leonel Sanches da Silva 88,623 -
2
votes1
answer136
viewsA: Authentication, email / password and knowing which bank is correct
1: Make two contexts: one of users, the other of tables of the system I think the idea is to have all the same contexts, with just the Connection String different. In this case, it is interesting to…
-
3
votes1
answer311
viewsA: Bootstrap organization and maintenance
What you call "Include", the name in ASP.NET MVC is Partial. Partials are code fragments (extension . cshtml, same as the Views), and that nomenclature is usually standardized with a "_" (underline)…
-
4
votes1
answer841
viewsA: Problem Dropdown menu bootstrap
There are two ways: 1. Preventing the standard behaviour of dropdown-toggle Add the following to your code: $('.dropdown-toggle').click(function(e) { e.preventDefault(); e.stopPropagation(); return…
-
2
votes1
answer120
viewsA: Run Trial with Codefirst
Warning: Running Stored Procedures on projects using Entity Framework Code First can be considered a bad practice, since the logic that should be in the application will be in the database, which…
-
2
votes2
answers539
viewsA: Entity Framework - Bank Compatibility
I wonder if I can migrate my applications and still use the resources of the Entity Framework, such as the aforementioned Code First. Yes, you can. The Nuget package below grants this support:…
-
7
votes2
answers1034
viewsA: Log in with network user
Configure your file Web.config with the following: <system.web> ... <authentication mode="Windows"/> ... </system.web> The user can be obtained using:…
-
4
votes1
answer529
viewsA: How to remove json xml encapsulation returned by Webservice
Write the return in Context.Response, not as direct function return: [WebMethod] [SoapHeader("UserAuthentication")] [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)] public…
-
-1
votes2
answers246
viewsA: How do I create a Team Project by branch from the code of another Team Project in TFS 2013?
Apparently you have to first create the team and then start the branch:…
team-foundation-serveranswered Leonel Sanches da Silva 88,623 -
7
votes4
answers2911
viewsA: Entity Foreign Key Framework
You are not making the context correctly observe your changes. The context always thinks that the entity coming from the screen is new because it has not loaded the existing record before. It would…
-
2
votes1
answer128
viewsA: Why does email get bad format when putting HTML in the body?
Missed you specify in your object MailMessage that the body of the email will be html. Also try to avoid putting HTML inside the property Body, because it doesn’t work very well. Create a…
-
3
votes2
answers190
viewsA: Code abstraction
Here’s what I’d do: public class Pergunta { [Key] public Guid PerguntaId { get; set; } [ForeignKey("OpcoesResposta")] public Guid RespostaCorretaId { get; set; } [Required] public String…
-
2
votes1
answer1387
viewsA: Login screen with Membership and mvc5
How I make a login screen using Membership and mvc 5? I’ll teach you how to method Simple Membership. Learned this, I can pass as makes a more sophisticated authentication scheme. First you need to…
-
5
votes1
answer121
viewsA: Performance to Render ASP.NET MVC Pages
The rendering performance of a View is related to a number of aspects: Controller performance; Amount of Filters and Interceptors involving your application; Amount of Javascript placed on View and…
-
1
votes2
answers785
viewsA: Initialize object in Asp.Net MVC
Your modeling is incorrect. The way it’s done, the ModelBinder (class that converts the values of the View in the parameter passed to the Controller) cannot make the association properly, because…
-
7
votes2
answers605
viewsA: What better way to organize and work with ASP.NET MVC routes?
Using as many routes as possible Default. For example: public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}");…
-
3
votes1
answer108
viewsA: Validations in Webpapi
From what I’ve researched, there are two ways: Using Simple AJAX; Using jQuery; Moreover, in this other article, it is recommended to implement a Filter to return the ModelState for the request…
-
1
votes1
answer50
viewsA: Scalability in systems . Net
What would be the best way to ensure scalability in the application/ database, using cloud computing? Using asynchronous architecture in ASP.NET MVC. Basically, its Controllers need to have the…
-
6
votes1
answer161
viewsA: "unveil" folder in GIT
git rm -r --cached <diretório> This command does not delete the local copy.
gitanswered Leonel Sanches da Silva 88,623 -
2
votes1
answer1957
viewsA: Include ZERO before the numbers in CSV file?
You can use it as follows: Convert.ToUInt64(item.CPF.ToString()).ToString(@"000\.000\.000\-00") This forces the CPF to pass through a mask specified in the second ToString(). EDIT For numbers only,…
c#answered Leonel Sanches da Silva 88,623 -
2
votes1
answer4278
viewsA: My view does not starta
The comment is clear: two are needed Actions to function, being one for the verb POST and another for the verb GET: public class LoginController : Controller { public ActionResult Login() { return…
-
1
votes1
answer570
viewsA: Log Navigation C#
For navigation, it is required to consult bringing all students: SELECT * FROM aluno Bringing only one record, the student list will come with only one record.
-
2
votes2
answers167
viewsA: Manipulating related data Asp.net and C#
If it is a RadioButtonList, I think it is easier to give the value by own RadioButtonList: switch (rdgTipoEntrada.SelectedItem.Value.ToString()) { case "Cortesia": ... case "Bônus": ... case "VIP":…
-
3
votes1
answer704
viewsA: Datetime field view in View without part of Hours
This problem is quite common when there is manipulation of DateTime in Views. The best way to solve it is by using the following: @Html.TextBoxFor(model => model.Data, "{0:dd/MM/yyyy}", new {…
-
1
votes2
answers115
viewsA: Orderby lambda keeps changing with every search
Just reverse the OrderBy with the Select. The return of Select does not guarantee an ordered list: Indicadores = (Pegatodos().Where(f => f.STATUS == "A") .OrderBy(x => x.SEQ) .Select(x =>…