Posts by Leandro Angelo • 9,330 points
440 posts
-
2
votes1
answer134
viewsA: View 2 dataTextField in a Selectlist
Just you popular your SelectList() with a List<SelectListItem> or compose another object with structure providing the values that will be used for the properties Value and Text. var…
-
2
votes2
answers138
viewsA: Combobox is not being filled in by the Items I want
Instead of adding a Planta in his ComboBox, add a SelectListItem. foreach (Planta result in plantas) { var item = new SelectListItem() { Text = result.Local, Value = result.Conexao }…
-
0
votes1
answer34
viewsA: How to get the Membernames property with the index?
Since MemberNames is a string[] and you want to retrieve the first value from it you can explicitly use index 0, provided that you check whether in fact the array has been initialized. Another…
-
1
votes2
answers133
viewsA: make div stay below the footer
First, do not repeat the value assigned id, below follows a simple example on what you would like to do. var rodapeFixed = false; window.onscroll = function(ev) { if ((window.innerHeight +…
-
0
votes1
answer108
viewsA: Search for missing record range
Although I don’t think this is the solution to your problem, this is an answer to your question. See two examples of how to find the first gap/hole in a set of codes represented as string, but can…
-
1
votes1
answer134
viewsA: Repeated data in html (ANGULAR)
See if it works. ngOnInit() { schedule.scheduleJob(' 15 * * * * * ', () => { this.MetaService.FiliaisMetaDiarias().subscribe( data => { const response = (data as any) this.objeto_retorno =…
-
0
votes1
answer382
viewsA: Open Webcam and capture image with C# in ASP.NET Webforms
You can simply use an input file with the attribute capture, if the device is available and the access is released by the user the capture will be done by it, otherwise it will open the dialog for…
-
0
votes1
answer79
viewsA: Problem with customErrors configuration ASP.NET MVC 4
In your default template, mvc will redirect the error to ~\Views\Shared\Error.cshml. You can simply replace this view with your own and no longer need to worry about it. If you look at the method…
-
1
votes1
answer65
viewsA: How to set a photo upload as a must
Your view model is not receiving one byte[] photo and yes a HttpPostedFileBase, you can store it as you are doing but for validation you need to take the required from the photo attribute and…
-
3
votes1
answer34
viewsA: Substitution within commas in C#
An option... var frutas = "f1,f2,f3,f4,..."; int posicaoSubstiuir = 3; string valorSubstituir = "Maçã"; string[] arrFruta = frutas.Split(','); if (arrFruta.Length >= posicaoSubstiuir)…
c#answered Leandro Angelo 9,330 -
0
votes1
answer71
viewsA: Rewind HTML5 video after clicking without acceleration or lag
So the acceleration happens because where you copied from, this seems to me to be the goal. If you want a Rewind as a "reverse play" you need to match the size of the range with the subtraction…
-
1
votes2
answers91
viewsA: Testing Plans in VSTS
To use these features you must have a Visual Studio Enterprise subscription or have an extension installed Test Manager which is available on Visual Studio Marketplace Follow the link,…
-
3
votes2
answers586
viewsA: Write checkbox value to sql server database
Replace all attributes you are trying to get the value of the cell, which are like this: chkitens.Parameters.Add(new SqlParameter("@CK_DESCRI", this.dgw_Xml.Rows[i].Cells[1].Value)); To:…
-
1
votes1
answer99
viewsA: How to treat an array with N lines and turn to a list to send to C#
If your goal is to post this value as String, you must first ensure that you are performing your post with the type in application/json. Create a Viewmodel to reflect the structure you’re posting:…
-
1
votes2
answers68
viewsA: Problem deleting a record, fetching the next
Your selection logic is a little fuzzy on yours Controller and can be simplified. And I changed your return object Json to ensure that it displays the property and value format and respects the…
-
3
votes3
answers80
viewsA: How to deal specifically with a Keynotfoundexception?
You can simply use the Linq, as in the example below: var dicionario= new Dictionary<string, string> { { "teste 1", "1" }, { "testando", "2" }, }; var idFormaPgto =…
c#answered Leandro Angelo 9,330 -
0
votes1
answer149
viewsA: Asp.net MVC form, no modal call after data validation
Your @if needs to be inside the Javascript block <script> function chamaModal() { $("#myModalAlert").show(); } @if (ViewBag.Message == "Acesso Negado") { chamaModal(); } </script> In…
-
1
votes1
answer122
viewsA: How do I perform select list list from the view for the Controller?
To receive the value of your select in Controller, you need to declare the attribute name. The id attribute has "only" usefulness for javascript and css, if the input does not have a name defined it…
-
2
votes1
answer68
viewsA: Pages . aspx in View folder in ASP.MVC project
In the case of a migration I recommend that you create a folder called "Legacy" or as "Pages" even (if you do not want to make this intention explicit" and add the Ignore of this route in your…
-
6
votes3
answers816
viewsA: Remove spaces from a string from the second occurrence
You can capture the position of the first space with the indexOf(), reserve this prefix, and reduce the scope of your replace(), but then the solution is not through regex. let str = 'abc defghijk…
-
3
votes1
answer177
viewsA: How to work with various parameters in c#
It actually depends on how your trial is going, but in the current scenario with the data provided, you could make a condition to determine which parameter will be sent according to your selection…
c#answered Leandro Angelo 9,330 -
1
votes1
answer97
viewsA: Turn the results of an HTML form into HASH with Jquery and Javascript
First, you don’t have an element with the id "debug" in your html, and even if you did you should alert for your .val(), in the case of an input, or by .text(), in the case of a <div>,…
-
1
votes1
answer292
viewsA: In Winforms how do the datepicker cursor walk when typing the date?
An outline solution is to use the SendKeys.Send() in the event of ValueChanged. So each time the value is changed in one of the properties, the selection will navigate to the next area. using…
-
0
votes3
answers523
viewsA: How to make a panel with double information with <tr>
If you need to use <table>, settle only with HTML and you really need to separate the title and the text into two lines... You can use rowspan and colspan. <!DOCTYPE html> <html>…
-
3
votes3
answers1061
viewsA: Knowing when your computer was Turned On / Off / Stopped
The problem mentioned in the question regarding the date presented is because you were receiving a list and were not consulting the value referring to an element of it, only the default of its…
-
0
votes1
answer228
viewsA: Pick the fields of a Select and pass to viewmodel
You don’t need to store the selection in a "Accounts" input that can even be done but you will need to change your model and add new treatments in the backend to process the entry As suggested in…
-
1
votes1
answer117
viewsA: Write a line in text file without using repeat instruction, is it possible?
Well, an alternative if you want to "avoid loopings" visible in your code is to use the string. Join(String, String[]). But under the table he will do more operations than those already existing in…
-
0
votes1
answer42
viewsA: Include jQuery outside the Root directory
If your application root is at the level of Projetos, you can’t go back a directory above it. Option 1: You simply copy your lib folder into projects <script…
-
1
votes1
answer45
viewsA: How do I update the photo ? At the moment it is only saving in the folder, wanted to display the image
It doesn’t make sense RedirectToAction("EditarCliente"); when you do an ajax post, for the AlterarFoto(), that only uploads the file. If you inspect the return of this request by the browser itself,…
-
6
votes4
answers3163
viewsA: How to get the computer name?
What you refer to as the full name is actually the MachineName and the name of HostName. You can obey him that way: static void Main(string[] args) { var nome = Environment.MachineName; var…
c#answered Leandro Angelo 9,330 -
0
votes1
answer38
viewsA: System of Transmission by the network
The question is very broad, but you can leave some basic concepts and practices. Most of these apps are connected to platforms or Apis that are in the cloud and what you see on your phone screen or…
javascriptanswered Leandro Angelo 9,330 -
3
votes1
answer81
viewsA: Duplicate element in DOM with JS
Since you are declaring the method to be executed directly on the button, it makes no sense that this adds an eventListener to the click event. <button id="btn"…
-
2
votes1
answer1250
viewsA: Consume SOAP from a Rest in Asp.Net Core 2.0
The easiest way is to add the reference to System.Service.Model of an older version of . Net (prior to core) and consume the service via BasicHttpBinding [HttpPost] public OptOutCliente…
-
1
votes1
answer21
viewsA: Onfocus input change type and assign a value at the same time
Just separate with a comma. <input type="text" name="dtfinal" onfocus="(this.value = '2018-06-21', this.type='date')" onfocusout="(this.type='text')" placeholder="Data Final">…
-
1
votes1
answer179
viewsA: Colorize Datagridview with comparison C#
You can use the event CellFormatting who will be executed before the surrender of his DataGridView on the screen during the DataBind(). private void dgvEstoque_pecas_CellFormatting(object sender,…
-
0
votes1
answer123
viewsA: Popular a View with values in the ASP.NET MVC model
You are changing the attribute of a Viewmodel you received as input in your Action, you need to remove it from Modelstate to persist the change. [HttpPost] public ActionResult Iniciar(NivelUmModel…
-
0
votes1
answer33
viewsA: Change a property value after aspnet click
It is returning to the form with null values because the Modelstate of your view is invalid in this case it returns to the form view and only redirects to index again if it is valid. See in your…
-
3
votes1
answer1913
viewsA: The name 'Component' does not exist in the current context
In your case the problem is why View Components is an appeal lodged at MVC 6 and Asp.Net 5 and its application is actually a MVC5 with Asp.Net 4 Below is an example of the implementation in…
-
1
votes2
answers719
viewsA: Refresh ajax mvc core page
Change the call sequence to arrange the execution of commands in the order you want. And forget the page Reload because it makes no sense in that context. On the close button invoke only the…
-
2
votes3
answers83
viewsA: Select different value from "X" name
The ideal is that you work with the 'sao paulo' region id and not with a text code. But just use the operator <> SELECT top 1000 * FROM [tabela_clientes] WITH (NOLOCK) WHERE STATUS =…
-
5
votes1
answer2005
viewsA: How to create a mvc project in visual studio code
To add an empty ASP.Net Core project, you must open a command prompt, navigate to the directory where you want to create it and run the following command: dotnet new web The MVC template already…
-
2
votes1
answer545
viewsA: How to create shortcuts with Javascript
The problem is in Return false if the user type anything other than alt+c and in the scope of the rest of his treatment. $(document).on('keydown', function(e) { console.log(e.which); // Retorna o…
-
3
votes2
answers784
viewsA: Vowel in full name C#
Although the answer of Thiago Loureiro solves much of the problem, because it is an exercise, I thought it valid to leave an answer explaining some important points that will clarify your doubts,…
c#answered Leandro Angelo 9,330 -
1
votes1
answer503
viewsA: Data return Json
Despite the same name the method Json(object data) in the Microsoft.AspNeCore.Mvc.JsonResult, that does not implement the argument of JsonRequestBehavior who was present System.Web.Mvc.JsonResult…
-
1
votes1
answer105
viewsA: How do you use the UPDATE command more than once?
Forget your DataGrid_CellClick is a different event than yours Btnfnz_Click. If you debug your code you will see that they run at different times and maybe the DataGrid_CellClick or be invoked when…
-
2
votes2
answers1312
viewsA: How to select one element within another with CSS?
Follow an example: .icon-box11 h4{ color:red; } .icon-box11 p{ color:blue; } <div class="wpb_wrapper"> <h4>H4 fora do icon-box11</h4> <p>P fora do icon-box11</p>…
cssanswered Leandro Angelo 9,330 -
2
votes1
answer32
viewsA: Problem storing HTML combobox label
Just call the function you created in the event onchange of your select. I took the Hidden type from your input only to display the result. function mudouValor() { var elemento =…
-
0
votes2
answers586
viewsA: Checking multiple <select> of same "name" if it is empty with Jquery
You can use a map to bring the selected values. $(document).ready(function() { var selecionados; $('[name="produto_qtd[]"]').on('change', function() { selecionados = $('[name="produto_qtd[]"]…
-
3
votes2
answers686
viewsA: How to place a button in a textarea in Asp.net, c#?
In this case, just "play" with CSS and don’t put your button in a new one <tr>. See the example below: textarea, input, button { border: 2px solid rgba(7, 143, 27, 1); padding: 5px 10px;…
-
2
votes2
answers184
viewsA: Can anyone explain this mistake to me?
The error is quite clear, foreign key conflict... You are trying to insert in the table [Produtos] a product with a Supplier that does not exist, in the case in the column CNPJ, which seems to be…