Posts by pnet • 14,727 points
909 posts
-
4
votes1
answer1034
viewsQ: Update edmx from the bank
I did an update model from database on my edmx. Well, the field I had added in the table appears in the diagram, but in the entity’s Cs, it continues with the old fields. What do I do, add in hand?…
-
2
votes1
answer126
viewsQ: Replace Webforms with MVC
Is there a way or a tool, just to avoid rewriting, to replace a code developed in Webforms and transport it to MVC? In Webforms there are runat=server, user control, Asp: Label etc... Example of…
-
3
votes1
answer611
viewsQ: Error while passing Adddays in Lambda expression
In this lambda, gives me the error below, when it enters the IF: var resultado = webDB.T_ControleColetor .Where(cn => cn.CNPJ == cnpj) .Where(dt => dt.DataControle == DateTime.Now.AddDays(-1))…
-
3
votes2
answers954
viewsQ: Filter on Where the longest date with LINQ
As I pass the Where of this max datatransaction, ie I wish to bring the result but by the highest date. var resultado = (from ci in webDB.T_Controle_Importacao where ci.CNPJ == cnpj let dd =…
-
1
votes2
answers771
viewsQ: Bring three possible results with Lambda
I need it in one expression to bring three possible outcomes. If date is up to 15dd, returns 1, if it is between 15 and 45 dd returns 2 and if it is larger than 45 returns 3. This is my lambda and…
-
6
votes5
answers27365
viewsQ: Remove jquery field mask
I have this code to put mask on the field: (function ($) { $(function () { $("#txtCnpjPesquisa").mask("99.999.999/9999-99"); }); })(jQuery); Now here I must pass the field…
-
1
votes4
answers20624
viewsQ: Error: Uncaught Typeerror: Undefined is not a Function
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script…
-
0
votes1
answer142
viewsQ: Load var into jquery with data from BD by Controller
To var str has script with fixed values. How do I get these values to be loaded from a BD through a controller? I already have the method that brings me this. var str = ""; var data = [];…
-
3
votes3
answers553
viewsQ: What is the difference between a web service in the same project and a different project in the same project?
Everyone tells me to create a REST and not SOAP. I know I’ll only get it well doing. I picked up an old project at the company where I’m with a web service in the same project. As I’m using MVC, I…
-
3
votes1
answer290
viewsQ: Questions regarding the use of . dbml files
I took a system in aspx(VS2008) and I will have to make some improvements, add other features and all this using MVC5. Well, there’s a web service, there’s a guy like that: static…
-
0
votes1
answer672
viewsQ: How to understand and start a Rest or Soap service
I still can’t look at a web service and tell if it’s REST or SOAP. The question is: When using one or the other How to differentiate when viewing the code if it is REST or SOAP Performance between…
web-serviceasked pnet 14,727 -
3
votes2
answers3617
viewsQ: My javascript function does not call controller action
I have this javascript function. function loginUsuario(){ alert(); if(($('#txtUsuario').val() != "") && ( $("#txtSenha").val() != "")) resultado = JQuery.parseJSON('{"Usuario": "' +…
-
0
votes1
answer117
viewsQ: Problems with references and MVC
I have a project where it works. I needed to create another project in another place and I took advantage of what I already have. It turns out you’re making a mistake on the basis.Initialize(...)…
asp.net-mvc-5asked pnet 14,727 -
-3
votes1
answer2310
viewsQ: Load "Hidden" fields by javascript
I have these fields hidden: <input type="hidden" id="idServico" /> <input type="hidden" id="trasladoServico" /> <input type="hidden" id="ingressoServico" /> <input type="hidden"…
-
0
votes1
answer69
viewsQ: Download content from Session in a class
I have a website that works like this. It has 6 steps. Routes, Air, Hotels, Services, Summary and Payment. Every step of this, I record in a Sesssion. After choosing each product on Session, another…
asp.net-mvc-5asked pnet 14,727 -
0
votes1
answer2844
viewsQ: Validate fields with selects (Combobox)
I have the code below that generates amount of rooms in my selects. str += '<select class="select-group" id="selQuartos">'; str += '<option>Qtd. quartos</option>'; for (var i = 1;…
javascriptasked pnet 14,727 -
-3
votes1
answer1423
viewsQ: How to place dots or location markers on the map
How to position those "markers" on my map, passing longitude and latitude? This is my HTML map script: <div class="map-canvas" data-opt=' + ' {"txtLatitude":' + this.Latitude + ',"txtLongitude":'…
javascriptasked pnet 14,727 -
7
votes3
answers12698
viewsQ: Difference between dates
Every time I pass the difference in dates in the same month, it works, but when it’s between different months, a negative value comes. How do I make a difference between dates? See my code. The…
-
-2
votes1
answer70
viewsQ: Doubt of licking on a guy
How do I make a lambda to bring only records that contain the word Transfer? For example, in my example, there are 19 records, but 3 are not Transfers, so it should come 16. Below my code and my…
-
2
votes1
answer143
viewsQ: Dynamically create controls
I have the following jquery function MontaTraslado() { resultado = jQuery.parseJSON('{"txtDestino": "' + $("#txtGeoTo").val() + '" , "datIda": "' + $("#txtDateStart").val() + '", "datVolta": "' +…
-
1
votes1
answer110
viewsA: When I load the class in the view, it gives Nullexception error
Well, I know it’s hard for anyone to solve problems remotely. And sometimes we have trouble giving the most accurate information. Often we post where the problem bursts, but often not where it…
asp.net-mvc-5answered pnet 14,727 -
-2
votes1
answer110
viewsQ: When I load the class in the view, it gives Nullexception error
That’s the mistake you’re making: This is the error line in my cshtml @( new HtmlString((SessaoUtil.Recuperar("TagGoogle") != null ? SessaoUtil.Recuperar("TagGoogle").ToString() : ""))) This is my…
asp.net-mvc-5asked pnet 14,727 -
0
votes2
answers7533
viewsA: The sequence contains no elements
It was resolved thus: string[] produtoId ; if (refeicoes != null) { for (int i = 0; i < refeicoes.Length; i++) { produtoId = pesquisaHotel.Where(x => x.SubOfferGroups.Select(a =>…
asp.net-mvc-5answered pnet 14,727 -
6
votes2
answers7533
viewsQ: The sequence contains no elements
That’s the mistake that comes. An Exception of type 'System.Invalidoperationexception' occurred in System.Core.dll but was not handled in user code Below my expression that generated error: if…
asp.net-mvc-5asked pnet 14,727 -
3
votes2
answers746
viewsQ: How to generate a sequence of dates from start and end dates?
Javascript and jQuery have been my executioners. I have a field hidden that has initial date and final date. As I do via javascript, a for to go filling a TD with the dates passed in that period,…
-
1
votes3
answers3432
viewsQ: How to take values from a Session and download them into variables?
I made that class: public class ConexaoParametrosTFV { public ConexaoParametrosTFV() { if ((SessaoUtil.Recuperar("ConexaoTFV") == null)) { AgaxturCmsEntities db = new AgaxturCmsEntities(); var…
-
0
votes1
answer674
viewsQ: Problem with javascript method coming from controller by Session
That is the mistake: Uncaught Typeerror: Cannot read Property '0' of Undefined Well, here’s the thing: I do a search on a WS. On the return of this search, I mount an html and play in my view…
-
-2
votes2
answers183
viewsQ: Show information when no data
I made a if, in case something comes back, then he mounts a page, otherwise he should hide everything and show a message. It’s not an Alert, but a message on the same page. On my Lse I just hide a…
asp.net-mvc-5asked pnet 14,727 -
-3
votes3
answers122
viewsA: Jquery does not return the minimum value when using Math.min( )
I resolved so: valor = this.SubOfferGroups[0].AnswerOffersList[0].SalePrice.DefaultValue; $(this.SubOfferGroups).each(function () { $(this.AnswerOffersList).each(function () { if(valor <…
-
0
votes3
answers122
viewsQ: Jquery does not return the minimum value when using Math.min( )
I have the function: $(this.SubOfferGroups).each(function () { $(this.AnswerOffersList).each(function () { menorValor = Math.min(this.SalePrice.DefaultValue); }); }); When entering the array…
-
1
votes1
answer100
viewsQ: Doing research inside a Session
I have a role in controller that returns me one JSON, who picked up a JQuery and mount my page. I, store her return in a Session, as below: SessaoUtil.SalvarSession("PegaHotelPacote",…
-
1
votes2
answers433
viewsQ: Function to clear html
How to make a function that cleans HTML? I have a field that comes from a WS and needs, before displaying on the page, to clear HTML. They sent me this: String result = Regex.Replace(htmlDocument,…
-
-2
votes1
answer118
viewsQ: Assign existing view to a controller
I have a view q is assigned to a controller. Everything was in this controller. Now we decided to create a controller for every situation we have here. Only I wouldn’t want to create a new view,…
asp.net-mvc-5asked pnet 14,727 -
-3
votes5
answers2197
viewsQ: How to create a switch.. case with value ranges?
If a total of days is over 30 and under 60, I do something. If it’s over 60 and under 90 I do something else and so on. How do I do this case? Did the case is the best option?…
-
-2
votes2
answers314
viewsQ: Return a class in jQuery
I have these Hidden fields in my cshtml: <input type="hidden" id="txtGeoTo" name="txtGeoTo" /> <input type="hidden" id="txtDateStart" name="txtDateStart" /> <input type="hidden"…
-
1
votes1
answer5007
viewsQ: Pass parameters via post to Controller
I have a CSHTML where the fields will turn into parameters, which will be passed via post to an existing method in a controller. How do I do this? I am searching, but I still have doubts about how…
asp.net-mvc-5asked pnet 14,727 -
2
votes2
answers5213
viewsQ: Consume web-service in ASP.NET MVC
I need to consume some methods on my page through a web-service. This web-service is in Europe. What is the best way to do it? What are End-Points?
-
3
votes1
answer1832
viewsQ: Hide parameters in the URL with routes and mvc 5
I have a route like this: routes.MapRoute( name: "RotaConteudo", url: "Conteudo/{name}/{Parametro}/{tipo}", defaults: new { controller = "Conteudo", action = "Conteudo", name = "", Parametro = "",…
asp.net-mvc-5asked pnet 14,727 -
1
votes3
answers388
viewsQ: Date reassembly with javascript
In my bank I have a Datetime field. In my form I have three combos for: Day, Month and Year. I have a Javascript function, which serializes the information by sending it to my record controller. It…
-
0
votes1
answer116
viewsQ: Dismember date to load javascript
I have in BD a Datanascimento field, where it is gurdada in YYYY-mm-dd format. I have a javascript function that scans the table by last CPF. If there is registration for the CPF, then it assembles…
-
4
votes1
answer1766
viewsQ: Mount URL without the Action or Controller name or both
Who has experience in and-Commerce, you know what I’m going to ask. Normally, when we create a route, and we call our Action related to that route, the URL is mounted like this:…
asp.net-mvc-5asked pnet 14,727 -
1
votes1
answer593
viewsQ: Problem redirecting page by route
These are the routes { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Pacotes", url: "Passo/{name}", defaults: new { controller = "Passo", action = "Passo_01", name = "" }…
asp.net-mvc-5asked pnet 14,727 -
3
votes1
answer191
viewsA: Link opening in a new window
I found the problem, which would be because of the attribute target defining when an HTML element <a> there is a custom destination, of which, in my case, it possessed the value _blank.…
-
2
votes1
answer191
viewsQ: Link opening in a new window
I have an image, which is a link to the index(home) page. It turns out that when I click on the link, the browser opens another window, but it should still open. How do I resolve this? Below my…
-
1
votes1
answer474
viewsQ: Grab Javascript/jQuery from a button
I have this button: <div class="grid_17"> <button value="novaPesquisa" class="btn-pular-passo pull-right" id="btnEndereco">Continuar</button> </div> There is a <form>…
-
1
votes1
answer122
viewsQ: Validation of fields in cshtml
I have seen some examples to validate fields, but all of them I have to inform which field or control to be validated, IE, I have to pass Name of the controls. In case I have a form with 20 fields,…
-
0
votes2
answers452
viewsA: Dynamically fill in combo with MVC 5
I solved it like this: Example for Day, but it goes for the others. <div class="grid_14"> <select id="txtDia" name="txtDia" class="grid_2" required> <option>Dia</option> @{…
asp.net-mvc-5answered pnet 14,727 -
1
votes2
answers452
viewsQ: Dynamically fill in combo with MVC 5
In my file .cshtml, I got these divs: <div class="grid_14"> <select id="txtDia" name="txtDia" class="grid_2" required> <option>Dia</option> </select> <select…
asp.net-mvc-5asked pnet 14,727 -
-2
votes2
answers143
viewsA: Function with jQuery recording in two tables does not persist in BD
The mistake was here: var result = []; The variable result had already been declared. I changed to: var dados []; Now you’re recording.…
-
2
votes2
answers143
viewsQ: Function with jQuery recording in two tables does not persist in BD
My need is as follows: write to a table, take the generated ID and write to the second table with this ID. As the order is to do this in jQuery, a function has been made (by a colleague). But…