Posts by Simão Lopes • 457 points
34 posts
-
1
votes1
answer42
viewsQ: Two databases communicate with the same template
I wanted to have a database for production and another for development separate the real data from the test environment data. The problem is I have no idea how to do that. I created a clone of my…
-
-1
votes1
answer31
viewsQ: Role Default Value in a dropdown
I have in my index users, each user has a Dropdown with the Roles, when Get does not show the value that is by default in Dropdown Controller: public ActionResult IndexGestor(string roles) { //query…
-
0
votes0
answers26
viewsQ: Values post in a Listbox without being selected
It is possible to make a Post of the values of a Listbox without them being Selected? My Listbox: @Html.ListBoxFor(m => m.SelectedCatequistas, new MultiSelectList(ViewBag.SelectedCatequistas,…
-
1
votes1
answer143
viewsA: Several "Divs" inside a foreach
<script> $(document).ready(function () { $(function () { $(".rak").rateYo({ onChange: function (rating, rateYoInstance) { $(this).next().text(rating); } }); }); }); </script> @foreach…
-
0
votes1
answer143
viewsQ: Several "Divs" inside a foreach
I want to put a ranking system with stars like "imdb", but the element only appears once within the cycle. Script: <script> $(document).ready(function () { $(function () {…
-
1
votes0
answers24
viewsQ: Return an array of values from checkboxes to the controller
I have a problem returning values from my checkbox list, the "checkedcatechesis" array does not reach my controller. Script: <script> $(document).ready(function () { $('[key]').change(function…
-
0
votes1
answer27
viewsA: Auto-fill the Listbox values as selected.
Okay. I solved the problem: $.each(myCheckboxes, function (i, obj) { itensListBoxCatequizandos.append('<option value="' + obj.val + '"> ' + obj.name + '</option>'); $("select…
-
0
votes1
answer27
viewsQ: Auto-fill the Listbox values as selected.
When the data goes to Listbox I wanted it to be selected immediately: I don’t know why it didn’t work. itensListBoxCatequizandos.append('<option value="' + obj.val + '"> ' + obj.name +…
-
0
votes1
answer220
viewsQ: Filling a Listbox with data from checkboxes
I am having problems filling my Listbox, I can fill the Listbox with the values of the checkboxes of the corresponding Labels. I’m running out of ideas how I’m gonna do this. The checkbox list is…
-
0
votes1
answer332
viewsQ: Join several values of type Iqueryable
I am receiving an array of values from my View with the days of the week. Sunday, Monday, etc. I want to compare this array with a string type attribute of my database and store it in a "Iqueryable"…
-
4
votes1
answer329
viewsQ: Send multiple values from my Checkbox to an Ajax call
I have a button that when I click calls my ajax function. I want to send the values that were selected in my checkbox.But what comes to my controller is only the first value of my Checkbox., Domingo…
-
0
votes2
answers79
viewsQ: Problems making ajax call with checkbox
I have several checkbox that will make an ajax call, but only the first checkbox You make the call. Any solution in the Ids for this list to make the same call ajax? Script: <script>…
-
2
votes1
answer121
viewsQ: Invoke selected Checkbox values in View Edit
I don’t know how to return the values selected in checkbox to the View. Controller: public ActionResult Editar(int? id) { // acedendo a um conjunto de valores de uma classe ViewBag.Daylist =…
-
1
votes1
answer19
viewsQ: Update a label with dropdown text
On my label appears all groups: ABC There should only be one group chosen by the dropdown, Example: To JS: $("#GrupoID").change(function () { document.getElementById("grupoupdate").innerHTML =…
-
0
votes2
answers62
viewsA: Pass text instead of id on dropdown
It was simplistic but it worked: ViewBag.AnoCatequeseID = new SelectList(db.AnoCatequese, "Ano", "Ano");
-
2
votes2
answers62
viewsQ: Pass text instead of id on dropdown
I wanted to pass the text of the dropdown to the controller(Post) instead of the id, I don’t know how I can do this. Controller: ViewBag.AnoCatequeseID = new SelectList(db.AnoCatequese,…
-
0
votes1
answer114
viewsQ: Format query to send to Viewbag
I did a query in Latin, but the result was not as expected, it seems simple the problem but I can not solve. Result on the label: { Year = 2016/2017 } Expected result on label: 2016/2017 Controller:…
-
3
votes1
answer322
viewsQ: Problem saving checkbox text value to my database
You wanted to save the days of the week selected by the user, storing the contents of the label as string. What comes to the controller when I select all checkboxes Domingo false Segunda-Feira false…
-
0
votes0
answers48
viewsQ: Textbox problem for autocomplete
I can not enter the method that makes the query to return the nomes and the id´s of the person. View: <script type="text/javascript"> $(document).ready(function () { });…
-
0
votes1
answer44
viewsQ: Problem in a dropdown
I have a very strange problem with my dropdown. When I load Submit this error appears: There is no Viewdata item of type 'Ienumerable' that has the key 'Diocese'. but I believe that the mistake is…
-
0
votes1
answer41
viewsA: Query n:m using the Entity Framework
Okay. I was complicating a no complication. public JsonResult GetParoquiasByVigararias(int id) { var paroquias = db.Paroquia .Where(p => p.VigarariaID == id) .Select(p => new { p.ParoquiaID,…
-
0
votes1
answer41
viewsQ: Query n:m using the Entity Framework
My problem with doing a "Many-to-Many" query. Receiving a View ID. In other words, I receive an id from the selected framework. 1 Catechesis has a list of parishes and 1 Parochia has a list of…
-
0
votes1
answer30
viewsQ: Problem to query inside the second Dropdown
Always enter ajax error: error: function (ex) { alert('Failed to retrieve vigararias.' + ex); } Screen error: Failed to Retrieve Vigararias. [Object Object] View: <script…
-
2
votes1
answer266
viewsQ: Select inside a dropdown using jquery
I can’t get the script to work. I have to do research into the second Dropdown (Scams) and save the ID of the second dropdown to make the Post the ID in the BD Controller: This Controller will seek…
-
0
votes1
answer56
viewsQ: Problem in View (details)
I am repeating the Letterpress in the View, how can I use the ". first" in the query in the controller? Error in the View: http://i.imgur.com/7t8AOJI.png? 1 View(details): @model…
-
1
votes1
answer62
viewsQ: List names in a query and send to a Viewmodel
I wanted to list the names belonging to a group and send to a Viewmodel and be collected by a View(details). Problem: 'Iqueryable' does not contain a Definition for 'Catechetizing' and in the…
-
2
votes2
answers46
viewsQ: ID is null when I enter the details by index
When I enter the registration details by the ID index it is always null. http://localhost:17542/Availability/Details/0 Controller Details: public ActionResult Detalhes(int? id) { var disponibilidade…
-
1
votes1
answer58
viewsQ: Query and view in dropdownlist
Is giving the error below in dropdowList and do not understand why. Error: Cannot associate the 'System.Collections.Generic.List1[<>f__AnonymousType82[System.Int32,System. Stri ng]]' to type…
-
6
votes1
answer185
viewsQ: Query Linq and see index
He wanted a query in Latin that shows the attributes of the availability table and the name of the respective catechist that is in the person table. At index will appear: Nome | AnoPastoral |…
-
2
votes3
answers185
viewsQ: Update to 2 tables
I cannot update the 2 tables. The problem is here. db.Entry(catequizando).State = EntityState.Modified; db.Entry(pessoa).State = EntityState.Modified; db.SaveChanges(); Some solution? Controller:…
-
2
votes1
answer122
viewsQ: Edit two tables simultaneously in an "Edit" view
I have two tables: Pessoa and Catequizando, with a 1:1 ratio and want to make a "Get" to the data of the two tables, both "id s" are equal, so I did the Catequizando catequizando =…
-
0
votes2
answers306
viewsA: Foreign Key error when deleting a record
Error 574 I think does not exist. I solved the problem in this way: Web file.config: <customErrors mode="On"> <error statusCode="500" redirect="~/ErrorPages/Oopss.aspx" />…
-
0
votes2
answers306
viewsQ: Foreign Key error when deleting a record
I have a table with products and another one with the category of this product. In the category table I have a detailsView with a delete button, and it deletes when a category is not associated with…
-
1
votes1
answer54
viewsQ: Add items to a dropdown control connected to a database
I have a control dropdown connected to a BD and wanted to add an item to force the user to choose an option. How can I add another item (choose/select/----------) to the control in order to force…