Posts by CesarMiguel • 4,800 points
128 posts
-
2
votes1
answer975
viewsA: Taking the content of a JS variable in an Asp.net C#
You can use the $.getJSON to do what you want: $.getJSON("/nomeTeuController/nomeTuaFuncao", { placa : placa, quilometragem : quilometragem, cor: cor, tipo : tipo, chassi : chassi, ano : ano, modelo…
-
3
votes2
answers568
viewsA: How I do a foreach inside the View in a Viewdata
Try: foreach(var un in (List<Unidade>)ViewData["ListaUn"])
-
3
votes1
answer54
viewsQ: Select label through . find
I’m trying to create/adapt a tree list, however I am not being able to expand my list by clicking on a label. List: <div id="listContainer"> <ul id="expList"> <li style="">…
-
2
votes1
answer210
viewsA: Nest <ul> tag in another <ul> tag with foreach
It is possible that it will give a tag error, by to put a ul inside others, you have to put it inside a li, getting something like: <ul> @foreach (var item in Model) { <li…
-
4
votes1
answer1838
viewsA: How to Use "Not Exists" in LINQ?
Try: db.Pessoal.where(a => !db.Producao.Any(b => b.Chapa == a.Chapa && b.Data == new DateTime(2014, 09, 02)) && a.Codsubord== "CB02010100"); So I’m getting all the data from…
-
15
votes1
answer105429
viewsQ: Insert line break (enter) using HTML codes
I’m trying to enter/break a line (\n, <br />, etc) in a title an html element. To do so, I searched for HTML Codes something that was equivalent to   used to give a "space". I found…
htmlasked CesarMiguel 4,800 -
2
votes4
answers405
viewsA: Hover does not work in div
First you have a mistake in class produtosHover css. You must remove the display: none;. Second, just add the css classes as follows: $(".produtos").hover( function() {…
-
1
votes1
answer78
viewsA: Save fk right after pk is generated with Entity
At the end of recording, go get the id table Responsavel won’t solve your problem? [HttpPost] public void GravaResponsavel(string _responsavel, bool _ativo) { using(RupturaEntities db = new…
-
1
votes1
answer3627
viewsA: Place local image on body when sending email
I have already found a solution, which involves creating a new local image shortcut that you want to add to the body of the message and add to the body: var contentID = "Image"; var inlineLogo = new…
-
2
votes1
answer3627
viewsQ: Place local image on body when sending email
To send an email from the application I am using the MailMessage available. I am now trying to place an image in the email body via html: MailMessage mail = new MailMessage(); SmtpClient SmtpCliente…
-
2
votes3
answers1008
viewsA: Solution for <select> with many options
You can always make an ajax call and get the value you have stored in the database (can you do that?). From there, just put a function on document ready page: $( document ).ready(function() { var…
-
0
votes2
answers142
viewsA: Is it possible to send a list of javascript objects to a function in the contoller?
The solution I found to my question is to create an array of all the id’s I want to pass to the function in the controller, instead of passing a list of objects. I then built the array in…
-
2
votes2
answers142
viewsQ: Is it possible to send a list of javascript objects to a function in the contoller?
I’m returning a data list of an object type (GAR) function actualizarGARs controller’s: var listaGARTratadas = db.GAR.ToList(); return Json(listaGARTratadas); And in javascript I wanted to send this…
-
5
votes1
answer844
viewsA: Format date and time and list according to current date
If I understand correctly, you want to list all your occurrences by date. If so, simply in the query made in the controller, sort by date: public ActionResult Inicio() { List<Ocorrencia>…
-
2
votes1
answer96
viewsA: Validating response in controller is giving error
Gives error because you really have no return if the condition of if does not check. A function of type JsonResult is always waiting for some kind of return. Makes: if(result_login.Count > 0){…
-
3
votes1
answer675
viewsQ: How to load an array and split its positions by special character
I have a table where there are filters for it: As you can see in the image, for each column I have a filter where user can type whatever they want to do the search they understand. Now I am allowing…
-
4
votes2
answers1628
viewsA: How to add Indice to an array
You can use the method push() javascript to do what you want. For example, taking your array: series = [{ name: 'Tokyo', data: [7.0, 6.9, 9.5] }, { name: 'New York', data: [-0.2, 0.8, 5.7] }] If you…
-
-1
votes4
answers3610
viewsA: Receive an array in the controller from javascript
Since I couldn’t solve this problem by returning a list of integers to the controller, I’ll leave an answer here with my solution (although that’s not how I wanted to solve it): In the javascript…
-
3
votes4
answers3610
viewsQ: Receive an array in the controller from javascript
I am creating an array with a javascript data list: var myArray = gvSortingListagemGARs.keys; Where I have the result: [278, 279, 280, 281, 282] Who are id's of elements of a Devexpress table. Now…
-
1
votes2
answers80
viewsA: Serialize xml output to class
To make the serialization I had to make some changes. Starting with Emailviewmodel: namespace MvcTesteLayout.ViewModels { [System.SerializableAttribute()] public class EmailViewModel { public string…
-
0
votes2
answers80
viewsQ: Serialize xml output to class
I have the following list of XML data: <xml> <cnt>7469</cnt> <emails> <item> <to_email>[email protected]</to_email> <id>3352143303</id>…
-
4
votes1
answer3207
viewsQ: How to check if an email has been sent successfully?
I am trying to verify if an email sent from my application is successfully sent, wanting to know if the recipient receives it or not (full mailbox, invalid email, around). From what I’ve researched…
-
1
votes2
answers1287
viewsQ: Know last index of a . each
I’m walking a .each and I would like you to present in the last position a alert. So I’m trying to get the last position of index: if (index == len - 1) { alert("Última posição"); } Complete code:…
-
0
votes2
answers721
viewsA: How do I direct an Action to a view inside a folder?
In your case I’d be: return View("UG/PDF/Lista");
-
2
votes2
answers7318
viewsA: show a div depending on the selected select
If you only have two options, you can even do it in javascript: alteraDiv = function (){ if($('#id_tipo_contacto').val() == 1){ $("#empresa").show(); $("#casamento").hide(); }…
-
2
votes1
answer141
viewsQ: Using Ipagedlist with multiple results
I am using Ipagedlist to list results in my application. But I’m trying to solve a problem: When I get a lot of results, going to the controller function to read the results from another page gets…
-
4
votes2
answers3291
viewsA: How to multiply the value of 3 inputs using pure javascript?
Your problem is that by doing onchange you are always passing two string’s, so you will multiply the value of the input you are passing (correctly) plus two strings. Your mistake was:…
javascriptanswered CesarMiguel 4,800 -
1
votes2
answers290
viewsA: How to create a checkbox name created with mvc helper
I think this is what you want: <td>@Html.CheckBoxFor(model => item.campoBD, new { }) Acesso Remoto</td>
asp.net-mvc-5answered CesarMiguel 4,800 -
3
votes1
answer1437
viewsA: Learning to use AJAX in ASP.Net MVC 4
You can even go through Jquery and it’s simpler: $("#divOcorrencia").empty().load('/Aluno/Details'); So you create a div where the details of the students will appear, and you load function in the…
-
0
votes2
answers2764
viewsA: IF condition inside _Layout.cshtml in MVC
You had an easier way of doing that. How? If only the menu on the left changes, just put it before the menu: @if (User.Identity.IsAuthenticated) { if (Roles.IsUserInRole("Admin")) { //MENU DA…
-
2
votes4
answers1297
viewsA: Download excel file
Using Epplus, here’s how I’m doing: var memoryStream = package.GetAsByteArray(); return base.File(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName);…
-
2
votes1
answer104
viewsQ: Make . append() before . load()
I’m using the .load() to load content (partial) from controller of my application. What I wanted to do before the .load, was to add code html while carrying a partial. I tried to do it .append…
-
2
votes5
answers27365
viewsA: Remove jquery field mask
Although your question is not well clarified (always informs which Plugin you are using), I will try to help. To find the value without the defined mask tries: $("#txtCnpjPesquisa").unmask();…
-
2
votes1
answer1707
viewsQ: Place border in split div
I’m trying to put a box around my form. So far so good, but now when I intend to divide the form in half this same box around the form ceases to work. <div class="formCreate " style="width:…
-
1
votes1
answer88
viewsQ: Error opening Partial’s in a new tab from a function in javascript
I have the following case: I have a navigation page of "Third Party", with several Partials defining their corresponding data. To do that navigation I’m doing by javascript, and carry the Partial as…
-
4
votes1
answer611
viewsA: How to change the folder in jQuery File Upload plugin?
From what I found online, you have three ways to do that: 1- Include in form <form id="fileupload" action="/Backload/UploadHandler" method="POST" enctype="multipart/form-data"> ... <input…
-
1
votes2
answers6651
viewsA: Image Upload
I usually store the image in a folder (in the project, or outside it), and only save the image name in the database. Now if you want to associate the image with the User, they need to have a…
-
3
votes2
answers46299
viewsA: How can I take the value of a text and print on the screen
To get the entered value, you can do as much by javascript as jquery. Having the input: <input type="text" id="inputValor" /> Javascript: document.getElementById('inputValor').value; Jquery:…
-
0
votes3
answers477
viewsA: CSS does not obey margin-right
I think what you want is this result: jsfiddle <div id="contact"><h1>CONTACTO</h1> <p>+(351) 967 181 237 +(351) 214…
cssanswered CesarMiguel 4,800 -
6
votes1
answer1029
viewsA: Save automatically generated excel in ASP MVC application
I already have the solution. To automatically save the generated Excel in the application just do: System.IO.File.WriteAllBytes(@"D:\Report.xlsx", memoryStream);//Guardar ficheiro automaticamente…
-
5
votes1
answer1029
viewsQ: Save automatically generated excel in ASP MVC application
I am generating Excel files in my application using Epplus. Now there is a need to automatically store these files in a folder, regardless of whether the user downloads them or not, in order to make…
-
4
votes2
answers275
viewsQ: Dar height and overflow-y in a div
I’m trying to give height and overflow-y in a div to limit the size of the div and add a scroll. Something like this: I’m uploading a list of data from the BD (I’m working on ASP MVC) to the div,…
-
6
votes1
answer776
viewsQ: Replicate/Copy elements from multiple tables
I have the following situation: The user has defined an establishment, where he has filled in data in two tables, and intends to replicate/copy all the same data, changing only the id of the…
-
5
votes1
answer1157
viewsQ: In a checkbox list, know which ones are checked
In my application I am printing a list of data coming database, and in each item of the list I am placing a checkbox, as shown in the following picture: Now by clicking "Start copy" I want to select…
-
1
votes1
answer154
viewsQ: Send email using Netoffice ASP MVC
I am starting to send emails in my application, so I am trying to use the package of Netoffice to send and receive emails. What I am trying to do is: From the account logged in to the local pc with…
-
3
votes1
answer263
viewsQ: Make if condition with split
I need to make a condition, where I check on a input the user entered the character .. So I’m making one if where I do split with my input value. if (idCliente.split('.')[1].length > 0) If the…
-
0
votes3
answers435
viewsA: Problem with users when publishing application
Well, after a few hours back from this problem I found the solution. I commented on my connectionString in the web config.: <connectionStrings> <!--<add name="DefaultConnection"…
-
2
votes3
answers1419
viewsQ: Make Backspace when pressing "+" key
In a given input allow the user to put whatever content they want, but by pressing the key + will open a pop-up (that is working) with data coming from the database. What I am trying to do now is:…
-
1
votes3
answers435
viewsQ: Problem with users when publishing application
I am using SQL Server 2012, and when publishing my application, both on the client server and on my pc everything works well. As connection strings for the BD are correct, everything looks good. Now…
-
3
votes4
answers167
viewsA: problem with C code conversion
You can use the && to represent the expression E, getting: if (MEDIA >= 6 && FALTAS <= 10)
canswered CesarMiguel 4,800