Posts by Randrade • 21,612 points
490 posts
-
1
votes3
answers4070
viewsA: Line Breaking Problems in Bootstrap
If you are using Bootstrap, use grid system, which, in my opinion, is the best feature of Bootstrap. Using the grids, your code would look like this: <div class="form-group"> <div…
-
6
votes2
answers5442
viewsA: Change menu color in page scroll
I don’t see any problems with your function. You should probably be overwriting some functionality. If this is the case you should "treat" what you want. Using your function, and assigning any…
-
1
votes1
answer1852
viewsA: How to use @Html.Validationmessagefor to change the text box class
You can just add the class to your @html.ValidationMessageFor(), being like this: @Html.EditorFor(model => model.Campo, new { htmlAttributes = new { @class = "form-control" } })…
-
3
votes1
answer752
viewsA: How to hide div when selecting radio options
You can simply check the event .change() and change the display. $(document).ready(function() { $('input[type=radio]').change(function() { if (this.value == 'geral') {…
-
0
votes1
answer1044
viewsA: How to set default date for DATE and TIME fields
For your dates, you can use the function Date() which is a feature of Javascript. Thus, you select the current date and add the values in the respective fields. Your code would look like this:…
-
3
votes1
answer304
viewsQ: Generate sequential key based on sum of digits
I have a cyclic function where a string may have any value in the checker digit, but all future submissions receive a pre-calculated value. In this role, I receive a string (which will always be a…
-
9
votes2
answers7536
viewsA: Select textarea text by clicking
In jQuery you simply use the event select(); $('#btnSelecionar').click(function(){ $('#txtInput').select(); }); <script…
-
4
votes3
answers2450
viewsA: Change readonly to various fields
I noticed you’re tagged javascript, but I also noticed that you’re using Bootstrap, with that you must be using jQuery. With that, I’ll leave an example in jqueryfor you. Using jQuery you just need…
-
4
votes2
answers335
viewsA: How to receive multiple fields from a view in the controller
This is another classic case of using the package Begincollectionitem. First, install the package via Nuget with the following command: Install-Package Begincollectionitem After that, change your…
-
2
votes3
answers1020
viewsA: Scrolltop with the field that is in focus
You can use jQuery to calculate the distance to the top, and after using the function scrollTop() to "take the input up". It would look like this: <script type="text/javascript"…
-
1
votes1
answer831
viewsA: Return view that is in another directory
In this case, you don’t need to change the route to display your view, just return it in your action, this way: public ActionResult Perfil() { var perfils = db.Perfil.Where(p => p.Nome !=…
asp.net-mvcanswered Randrade 21,612 -
1
votes1
answer252
viewsA: Expandable navbar
You can use the Collapse bootstrap itself to do this. Your example would look like this: <html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8">…
twitter-bootstrapanswered Randrade 21,612 -
2
votes1
answer2414
viewsA: How to make a search box with Hover effect?
I will leave an alternative using jQuery and css. Suppose you have a button and an input in your form. Let’s hide the input, and show only when you click the button (magnifying glass); For this, we…
-
5
votes6
answers17707
viewsA: How to validate date with Angularjs or jQuery?
You can use the jQuery Validation to validate your fields. It is only in English, but has some libraries for translation. An alternative is to use these extensions. Where you add validation to your…
-
6
votes3
answers721
viewsA: Why isn’t onBlur being executed?
There is nothing wrong with your code. It may be just the order or the moment you are calling the same. <html><head> <meta http-equiv="content-type" content="text/html;…
-
7
votes3
answers2268
viewsA: Site within App
One option is to use the component Webview android. This component serves as a view that displays HTML files. Summarizing, it "puts" your website inside an application (.apk), and when running the…
-
1
votes1
answer346
viewsA: Ignore CSS Class on a specific page
Using Your Example. As you do this: #wrapper input:not(.ignoreCss) {...} you’re ignoring css only for inputs, not the full page. To eliminate from the full div, you could do this: #wrapper…
-
7
votes2
answers9136
viewsA: Create static Selectlist and pass a selected item to the View
Following your model, I will change only the way to pass the data to the view. In place of a Selectlist I will use the Selectlistitem, and in place of ViewData, one ViewBag. Your controller would…
-
2
votes1
answer493
viewsA: Relationship Problem with EF6 (Relationship and Associative Class)
If your intention is to use an associative table, you must create it and carry out the appropriate associations. In this case, you would need to create the entity Territories. As your model SQL…
-
1
votes4
answers7859
viewsA: Take ID value and place inside the Hidden field
It’s basically the way you’re already doing it. Let’s say you already have the input, just look for the id and set the value. It would look like this: <input type="hidden" name="txtValor"…
javascriptanswered Randrade 21,612 -
6
votes3
answers3091
viewsA: Ordering select in alfábetica order with jQuery
You can extract the values from each option in a array, order the values and after, update your select. That would be your code: $( document ).ready(function() { var n; var selects =…
-
1
votes2
answers314
viewsA: Convert to R$nomenclature
Using javaScript pure, you can use the method Replace() to do what you wish. Below I will leave two functions, one to format the formatted value, and another to remove the formatting and return the…
javascriptanswered Randrade 21,612 -
5
votes2
answers3787
viewsA: Show Tabulated in HTML Table
To accomplish what you want, you need to create a table in your code html and in his for, you add the values according to multiplication. Using your code as an example would look like this:…
-
1
votes2
answers1501
viewsA: Dropdown Menu ASP.NET MVC 5
There are no problems with your code. probably should the conditions in your if's are not being filled in. Remove these checks, and test your menu without them. Test your code like this:…
-
4
votes1
answer887
viewsA: Sending via Formcollection of monetary values
For this you will need to add the package Begincollectionitem in the Nuget. Install-Package Begincollectionitem After that change your view for: @using (Html.BeginForm("PagamentoConfirmed3",…
-
1
votes2
answers147
viewsA: Error loading Dialog Widget() jQuery in ASP.NET MVC
Let’s go in pieces. Here you already own one Bundle to the jQuery. bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); Therefore, you do not need to…
asp.net-mvcanswered Randrade 21,612 -
10
votes2
answers8235
viewsA: How to place a clickable area on a piece of an image?
Reusing the map that Onosendai posted, you can add the library jQuery RWD Image Maps to automatically resize your image coordinates. jQuery RWD image maps Allows image maps to be used in an agile…
-
1
votes1
answer54
viewsA: Error with 1 relationship for many, Power Tools does not generate model
I’m going to make some small changes to your code. Its entity Territory would look like this: [Table("Territorio")] public class Territorio { [Key] [DisplayFormat(DataFormatString = "{0:0000}",…
entity-frameworkanswered Randrade 21,612 -
1
votes2
answers102
viewsA: Active menu item but no longer works as link
In your script you are using the e. preventDefault(); which serves to prevent the default event from occurring, in your case, going to other pages. To resolve this "problem", simply remove the…
-
0
votes1
answer49
viewsA: Prealoder when requesting dowload
Suppose you already own the preloader ready (html, css, js) and need only call and hide the same at the time of download. If you don’t have, here is an example. You can use ajax to call his…
-
14
votes2
answers127257
viewsA: Put a background image and make it responsive
You can just add the property background-size: cover; in his css. Cover: specifies that the background image shall be sized so that it is as small as possible while ensuring that both dimensions are…
-
0
votes2
answers782
viewsA: How to make space in the checkboxlist text created dimanically
You can create a class on css to leave it the way you want it checkBox. For the example, we will add a class in the checkBoxList (CssClass="chkEscolhaOpcao") and use css to modify the style.…
-
4
votes3
answers1861
viewsA: C# MVC Run Function (Logout) When Closing Browser
You can use the function Unload() of jQuery to capture the moment browser is closed, and from this moment, you make a call via ajax to the Action desired. Before, you check whether the browser has…
-
1
votes3
answers115
viewsA: Vertical side menu up to the thin page
Since you are using the Bootstrap, just use the Affix(). With it you leave a side menu similar to the site’s own Bootstrap. An example using it would be like this: <body data-spy="scroll"…
-
1
votes3
answers2006
viewsA: Show hidden div according to the value of a Dropdown
You can use jQuery to obtain the value selected and perform the comparison. If the value is < 8, shows a div, or it shows another or hides the same. It would look something like this: Let’s say…
-
3
votes3
answers1053
viewsA: How to update with SQL Server count?
Let’s say you have the following table: CREATE TABLE [dbo].[Pessoa]( [nome] [varchar](50) NULL, [posicao] [int] NULL ) For this, we will use this insert as a basis: insert into pessoa values…
-
0
votes1
answer187
viewsA: Using Javascript with AJAX
You can create a page Cpf as parameter and returns the client data in json. In doing so, you perform the search with the ajax, and fills the values in the inputs. I’ll leave an example using CEP’s…
-
2
votes2
answers516
viewsA: Datatable column filter Asp net mvc5
By default, the dataTables has a global filter, where it filters the data of all table elements. By your question you are wanting a filter in each column. For this, just modify in order to add a…
asp.net-mvc-5answered Randrade 21,612 -
3
votes1
answer252
viewsQ: More performative way to return data to the View
In a view where we return a list of objects, and we need to demonstrate the quantity, as a small report, using some conditions. What is the most performative way to return data to view? Explaining…
-
6
votes2
answers7119
viewsA: How popular a Dropdownlist from another Dropdownlist
I believe you’re referring to a Cascade Dropdownlist. Where you select an object in the first and use the value as a parameter to fill the second. Very common in registers using Country/State/City.…
-
5
votes2
answers398
viewsQ: Glyphicons with error when publishing to IIS
I’m developing an application with Asp.net-mvc-5 and Bootsrap 3.3.5. In the visual studio, it works perfectly. However, when publishing the application in IIS 8, the bootstrap-glyphicons appear with…
-
1
votes2
answers1180
viewsA: Validationsummary - Asp.Net MVC problems
You can work with TempData[""] to take that information. In this case, you would do it in your controller: if (curso.Qtd_Vagas <= 0) { TempData["MensagemErro"] = "Não existem mais vagas para este…
-
0
votes3
answers1920
viewsA: Search database information by selecting a field
For this, you can make a method that returns all users in Json in his controller, would look like this: Fetch method in controller: public JsonResult ObterPorId(int id) { //ViewBag para listar todos…
-
2
votes2
answers298
viewsA: Convert Linq query to Dapper
The only problem I see in your code is separation of the code by + . Try to put inside a single "seletc". And in the Spliton, put the keys to your entities. That would be your code: public…
-
7
votes1
answer1024
viewsQ: Query user data logged in Windows Authentication
In my application I use the authentication mode="Windows" as a form of authentication. This way, I can know the user name, referring to the field in AD and the domain of the same using…
-
0
votes1
answer499
viewsA: Mask in Ajax table
I used the Replace() for this. Where I pass the to my variable the way to display the values. So was my table: linhas += " <td>" +…
-
1
votes1
answer499
viewsQ: Mask in Ajax table
I own a autoComplete that I developed, where when typing some value, the system returns a table with the data of this autoComplete. This table is being returned via Ajax. However, I would like to…
-
1
votes1
answer64
viewsA: Save data by disregarding hidden DIV’s
Following the idea of @Luishenrique in the comments, I disabled the inputs of div's hidden, thus sending only the necessary data. My script got this way: <script> var select =…
asp.net-mvc-5answered Randrade 21,612 -
2
votes1
answer64
viewsQ: Save data by disregarding hidden DIV’s
In my View i own a select that hides and shows thediv in accordance with the select chosen. This part, is working correctly. This select has three options, and the form changes according to the…
asp.net-mvc-5asked Randrade 21,612 -
4
votes1
answer541
viewsA: Why isn’t my CONTROLLER picking up VIEW fields?
When you use tags without Html Helpers you must put the name of the property. in your case, you are just adding the ID. Thus, by giving the submit, your View does not recognize the property, thus…