Posts by Diego Zanardo • 3,301 points
100 posts
-
0
votes1
answer1768
viewsA: How to increase height as scroll scrolls down the page but not decrease with scrolling up?
Mauro, you just need to check scroll is greater than height of div: $(function(){ $(window).scroll(function() { var $broca = $('#broca'); var st = $(this).scrollTop(); if (st > $broca.height()){…
-
2
votes2
answers17094
viewsA: How to validate password through Javascript
Add to Form the onsubmit: onsubmit="return validarSenha();" <form action="troca_senha.php" method="POST" id="FormSenha" name="FormSenha" onsubmit="return validarSenha();"> Modify the type of…
-
1
votes2
answers270
viewsA: Link to display attachment
A while back I was having that problem too. After searching, I couldn’t find a way to do this through ASP.NET. The method I was able to do to solve the problem was to add an event to the LinkButton:…
-
12
votes1
answer633
viewsQ: Design Pattern
Good use the following design pattern: Where the Interface will communicate only with the application and this will communicate with the Repository. Thus the interface will have no restrictions and…
-
2
votes2
answers2419
viewsA: Query with related data in the Entity Framework
Try this: IEnumerable<Material> materiais = db.Material .Include(u=>u.Unidade) .Include(t=>t.TD) .Where(x => x.Nome.Contains(Nome)).ToList(); Don’t forget to import the reference:…
-
0
votes2
answers379
viewsA: Json format on return
Try this: public JsonResult Data() { var grupos = grupoService.BuscaTodos().Select(data => new { data.Id, data.Nome, data.Descricao }); return Json(new { rows = new { data = grupos } },…
asp.net-mvc-5answered Diego Zanardo 3,301 -
2
votes1
answer472
viewsA: Validate without post with html helper Asp.net mvc
Don’t forget to add to which Model to View refers: @model Dominio.Categoria [View] @model Dominio.Categoria @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(true) <div…
asp.net-mvc-5answered Diego Zanardo 3,301 -
0
votes4
answers95
viewsA: Add a "pass" limit to a Carousel slider
I believe it has a more optimized shape, but works perfectly. var sliderWidth = 300; var slider = $('#slider'); var sliderCount = $('div', slider).length; var cont =1; $(document).ready(function() {…
-
4
votes2
answers393
viewsA: Load Only part of the Site by clicking Actionlink
Based on that reply. One option is to use Ajax. An example of how to use it: <script> function Open(url) { Carregar(); url = '@Url.Content("~/")' + url; $.ajax({ url: url, type: 'GET',…
-
5
votes2
answers124
viewsA: How I give a Sort on my dropdownlist
Try the following: @{ var estados = new List<ListItem> { new ListItem { Value = "AC", Text="ACRE"}, new ListItem { Value = "AL", Text="ALAGOAS"}, new ListItem { Value = "AM", Text="AMAZONAS"},…
-
5
votes1
answer192
viewsQ: Database Allocation
I have some questions regarding my database. I use an MS-SQL "database", which is provided by Locaweb (I don’t have very clear this concept of Locaweb providing me with a "database" which has within…
-
0
votes1
answer771
viewsQ: Parallax Scrolling Horizontal
I would like an explanation of how Parallax Scrolling Horizontal works. Effect equal to this site.
-
9
votes4
answers2911
viewsQ: Entity Foreign Key Framework
My domain: public class SBE_ST_CorpoDocente { public int Id { get; set; } public string Nome { get; set; } public virtual ICollection<SBE_ST_Curso> Cursos { get; set; } } public class…
-
2
votes1
answer61
viewsQ: Search in checkbox list
I would like to do a real-time search. Similar to the Datatables, but in a "list" of Checkbox. Follow my list of CheckBox <div class="panel-body"> <div> <label> <input id="chk"…
-
0
votes2
answers785
viewsA: Initialize object in Asp.Net MVC
Supposing that your class Estado be the following: public class Estado { public int ID { get; set; } public String Nome { get; set; } } To use class constructor Cidade, You’d have to do the…
-
1
votes1
answer204
viewsA: Recovering Multiselectlist MVC values
If you recover the dados["Combos"], will recover all that were selected, so just take a split. var combos = dados["Combos"].ToString().Split(','); foreach(var combo in combos){ //vai percorrer todos…
-
1
votes1
answer62
viewsA: Model Create Ienumerable one for many
I don’t know if it’s the best solution, but one solution is this:: @{ IEnumerable<Produto> produtos = ViewData["Produtos"] as IEnumerable<Produto>; IEnumerable<Categoria>…
asp.net-mvcanswered Diego Zanardo 3,301 -
0
votes2
answers723
viewsQ: Xmlhttprequest Expect Response
I would like my Xmlhttprequest to wait for the answer. function UploadFile(campoFile, urlUpload, campoNome) { var img = $("#" + campoFile).val(); var resultado = false; if (img) { var file =…
-
2
votes2
answers192
viewsA: jQuery Date "Invalid Date"
Rafael. Try using this date format. var countTo = new Date("2015/07/09 10:00:00");
-
4
votes1
answer128
viewsA: XML query does not return values
Remove the Where, because with the Where it will filter only the <simbolo>H</simbolo>, and there’s no record of that tag. where p.Element("simbolo").Value == "H" Thus remaining:…
-
4
votes4
answers818
viewsQ: Database being changed/Hacked
I don’t know if I can ask that question here, otherwise I can ask you to suspend the question, or warn me that I delete it. For the second time I came across a bank that had been broken into. Almost…
databaseasked Diego Zanardo 3,301 -
2
votes3
answers1758
viewsA: Do I need to insert an HTML tag with jQuery to encapsulate the code below?
I don’t know if I understand your question, but it wouldn’t be that? var s; $.each(...) { s = s + montarDiv(); }); $("#main_div").append('<div id="pegatudo">' + s + '</div>'); function…
-
2
votes1
answer415
viewsA: Dropdownlist with unique MVC values
Rafael. Try this: [Controller] var list = new SelectList(bdAlbum.ListarTodos().OrderByDescending(x => x.Nome).GroupBy(x => x.Nome.ToLower().Trim()).Select(y => y.First()) , "ID", "Nome");…
-
0
votes5
answers25953
viewsA: <input type="image" ...> with LINK and HOVER
Just by complementing the @Beet response, you can also use Webkit. .botao{ background-image: url(http://www.naturaljoias.com.br/images/botao%20coco%202%20cm%20vermelho.jpg); -webkit-background-size:…
-
2
votes2
answers1410
viewsA: File upload does not work on Locaweb hosting
I’ll leave my comment as an answer. So if another user is having this problem, it might help. Contact Locaweb and they take care of these privileges. The problem is permissions, they are the ones…
-
3
votes1
answer1911
viewsA: Jquery Navbar Fixed after scrolling
Try to use this: var num = 50; // tanto de scroll que vai precisar para a barra ficar fixa. $(window).bind('scroll', function () { if ($(window).scrollTop() > num) {…
jqueryanswered Diego Zanardo 3,301 -
2
votes1
answer298
viewsA: Razor - @Html.Dropdownlist with dynamic name
Do it in your Model: public string ConcatenarNome { get { return string.Format("Nome{1}", Id); } } And then on View: @Html.DropDownList(@Model.ConcatenarNome)…
-
1
votes1
answer141
viewsQ: Resource with database
Well I have the following environment: Table: Livro id titulo tituloEN descricao descricaoEN Controller: [LivroController] public ActionResult Index() { var livros = bdLivro.ListarTodos(); return…
-
2
votes2
answers942
viewsQ: Multi Language ASP.NET MVC
I have an ASP.NET MVC application. And I need to make it multi-language, using a database. I thought of two approaches: Livro Titulo Subtitulo Idioma OR Livro Titulo TituloEN Subtitulo SubtituloEN…
-
1
votes3
answers262
viewsQ: A column in several rows
I already searched in documentation and could not get the expected result using bootstrap. The image illustrates better what I want to do <div class="container"> <div class="col-lg-4">…
-
6
votes4
answers6579
viewsQ: Resize image
Well my system has an area where the user registers information about the site. So register images. The system does not restrict image size. Then on the site are presented the images. However there…
-
17
votes2
answers9076
viewsQ: MVC Asp.net paging
Currently I work with the data like this: Context returns to me all Bank Customers public IEnumerable<Clientes> ListarTodos() { return contexto.Clientes.ToList(); } In the controller I call…
-
5
votes1
answer677
viewsQ: How do I create scheduled events in SQL Server, similar to Mysql’s "Event"?
In Mysql I used this syntax to create a scheduled event: CREATE EVENT 'evento_LimparPaper' ON SCHEDULE EVERY 1 MONTH STARTS '2014-06-3 00:00:01' ON COMPLETION NOT PRESERVE ENABLE COMMENT '' DO BEGIN…
-
3
votes2
answers133
viewsQ: Loop Loop C# Asp components
You’d have to do a loop loop in this case? PaperBLL paperBLL = new PaperBLL(); List<PaperEO> papers = paperBLL.SelectPapers(); HyperLink1.ImageUrl =…
-
4
votes2
answers731
viewsQ: Change Context according to application
I need to point out in the web part what context the system will use. My project is divided as follows: After its completion I had to "replicate" it, but using another bank. The tables are equal…
-
0
votes1
answer126
viewsQ: Force the import of css and js on site pages
<nav class="navmenu center"> <ul> <li class="first scroll_btn active" onclick="atualizarPagina('Home.htm');"> <a>Home</a></li> <li class="scroll_btn"…
-
2
votes1
answer1214
viewsQ: Permissions of users
I do not know how I can be implementing in my systems the permissions of users and I would like you to give me some north. From my own class: public class Loja_Usuarios { public int ID { get; set; }…
-
2
votes1
answer914
viewsQ: Upload ajax file Asp.net-mvc
I have the following problem when using file upload. ajax performs "at the same time" both actions. And I would like him to perform the ulpoad action and then the other. Or else another way to…
-
0
votes1
answer1032
viewsQ: Action redirect another Action using Partialviewresult
public PartialViewResult Index(string quantidadeRegistro) { int qtd; int.TryParse(quantidadeRegistro, out qtd); var bdPedido = PedidosAplicacaoConstrutor.PedidosAplicacaoEF(); var bdCliente =…
-
0
votes2
answers1336
viewsQ: Loading with Ajax
I wanted to know how to make an image, or something, to indicate that the page is loading. I have a process that takes about 7 seconds and for the user not to keep clicking thinking it was not, I…
ajaxasked Diego Zanardo 3,301 -
6
votes3
answers3565
viewsQ: Use ajax with Actionlink
I want to change the ActionLink and the URL to work with Ajax, but I don’t know how to do it. Follow my code with ActionLink and URL. <ul class="nav" id="side-menu"> <li> <a…
-
2
votes2
answers510
viewsQ: Optimize operation with lambda
I have the following classes: public class Pedidos_Itens { public int ID { get; set; } public int Qtde { get; set; } public Pedidos _Pedido { get; set; } public int Pedido { get; set; } public…
-
3
votes2
answers2093
viewsQ: Send file from one server to another
The application is on an X server. From a precise upload file the file is sent to a Y server. However, I can’t find any solution for this. The application is in MVC Asp net. To upload the file to…
-
4
votes1
answer195
viewsQ: Group by with Lillo
I have the following tables: **Aula** Id Nome Data **Avaliacao** Aula_Id Aluno_Id Organizacao Didatica To get a Join of the tables I use the code: var result = from a in mdc.SBE_AA_Aulas join av in…
-
2
votes1
answer719
viewsQ: Ajax Receive String List from a Webmethod
I need to pass a string list of a server method to ajax, but it doesn’t work. If I just pass a string it works. Follows the code: [System.Web.Services.WebMethod] public List<string>…
-
5
votes1
answer147
viewsQ: How ajax does to identify classes
I have the following application: function atualizarPrdutos(categoria){ $.ajax({ type: "POST", url: "teste.aspx/InsertData", data: JSON.stringify({categoria:categoria }), contentType:…
-
1
votes3
answers4404
viewsQ: Hide youtube link
I’m developing a video course system. I wonder if there is any way to take a video from youtube, and put on the site in a way that the user can not (difficult) view the youtube link, so that can not…
-
5
votes3
answers2113
viewsQ: Application that does not need to load full page
How can I create an MVC C# with Razor, where I have a Layout and then just update the central content and not the page as a whole. I read some places to use AJAX another to use PartialView. But what…
-
10
votes2
answers7394
viewsQ: Entity Framework update and delete associative entity
I have a student table that has many to many relationship with the course table. Thus resulting in the table CursoAluno. I would like to know the correct way to the update and the delete table…
-
7
votes2
answers6973
viewsQ: Many Relationship for Many Entity Framework 6
Good morning, I have the following classes: Consul_ca_student: public class CONSUL_CA_Aluno { public int Id { get; set; } public string Nome { get; set; } public int Cpf { get; set; } public string…