Questions tagged as 'asp.net-mvc'

1
answer

How to load a PartialView to create a comment

I'm working on a project to learn ASP.NET MVC and Razor. I currently have a post template with a view , and a view associated with the model class comment to create a new comment. I would like to know how to do to put the view comm...
asked by 14.12.2016 / 20:53
1
answer

Validation for TextArea using Razor MVC 4

I have the following modal and need to include validations so that the textarea is required when clicking the "Yes" button, that is, it can not be sent blank, and that textarea is at least 15 characters. @model TClient <di...
asked by 03.02.2017 / 19:27
1
answer

Working with anonymous type

I have the following code snippet: var filter = new { categoria = 1, cond2 = foo, ... }; p = new ProdutoBusiness().listarProdutos( filter ).ToList(); I wanted to work with this anonymous type as a parameter to filter, but I do not know how...
asked by 12.12.2016 / 21:07
1
answer

How to open file with window.open in a post?

My controller returns two file types: pdf and excel. return File(stream, "application/pdf"); return File(new MemoryStream(ep.GetAsByteArray()), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"Relatorio.xlsx"); When t...
asked by 02.02.2017 / 17:04
2
answers

How to fetch a json value from the goo.gl API for C #

I'm trying to use the goo.gl API to shorten some link. The problem is that I do not know how to pull the generated URL from the json return. See below how it is organized: { "kind": "urlshortener#url", "id": "AQUI VEM A URL DO GOOGLE", "lon...
asked by 23.02.2017 / 14:00
1
answer

Open Search Description (press tab to search)

I made a system extensions for the company and wanted to implement in this system the "tight tab (tab) to search" that I see on various websites. I've done it in every possible way and I can not seem to make it happen. The xml code I use look...
asked by 05.01.2017 / 15:03
2
answers

Giving Hide on an ActionLink, is it possible?

I would like depending on whether my ActionLink was visible or not. Razor : <td> @Html.ActionLink("Cadastrar site","MontarFancyCadastrarSite", "ItemOS", new {ChaveOS = Model.ChaveOS }, new { @class = "siteFancybo...
asked by 03.01.2017 / 22:02
1
answer

Fluent API Modeling with Reference Table

I would like to know how to perform the modeling of a particular entity, where its reference value belongs to another table. This reference value would be a domain table that has its ID's for credit cards, since my user can register that their s...
asked by 20.11.2016 / 00:09
2
answers

How do I checkbox asp.net mvc database

Hello. I'm doing a project for a music player. In the PlayList register, I would like the songs to appear in a checkbox in order to mark the desired ones and save them to the database. This is my controller: using System; using System.Colle...
asked by 19.11.2016 / 20:29
1
answer

Retrieve the value of a dynamically generated field

Good morning. I would like to know how do I retrieve the value of the control that is generated dynamically in my form at runtime? Type below in the image I have a class that brings all the properties of the controls to be shown in the Client Vi...
asked by 31.10.2016 / 14:30