Questions tagged as 'asp.net-mvc'

2
answers

Check two null fields with Data Annotation

I have two properties: public int? Inicio {get; set;} public int? Final {get; set;} Both accept nulls and are not required. I wanted to check if the two are null using Data Annotation . The operation would look something like Compare...
asked by 03.12.2015 / 21:11
1
answer

Exception when you will generate boleto bancário with Boleto.Net

I have a system that generates Santander tickets using a specific DLL that has been downloaded from the internet. The name is "Boleto.net". I need to create a Bradesco ticket. I changed where the Santander bank data passed to the Bradesco data,...
asked by 05.08.2015 / 14:27
2
answers

How to Fill a DropDownListFor

Can anyone help me how do I fill out a DropDownListFor ? Before I was doing it this way: @Html.DropDownList("lstAffiliate", string.Empty); But I saw that it was not recommended, so I decided to do it with ListFor . I have...
asked by 15.06.2015 / 19:28
1
answer

How to pass parameter from one Controller to another in Asp.Net

Hello, I have an object that needs to pass by parameter to another Controller through RedirectToAction , I used TempData however after any page change it loses the reference, know of some solution so that it does not lose the referen...
asked by 16.05.2014 / 22:23
1
answer

Reflection Emit, what's the use?

Passing a code to MVC, I saw that there was a Label label= new Label(); that was underlined with red, when clicking to see the suggestions, I saw the following: using System.Web.Ui.WebControls using System.Reflection.Emit I was won...
asked by 07.07.2014 / 18:00
2
answers

Change the Context according to the application

I need the web part to point out which context the system will use. My project is divided as follows: AftercompletingitIhadto"replica it", but using another bank. The tables are the same does not change anything, but it is in another bank...
asked by 02.07.2014 / 17:22
3
answers

What is the best way to save a Group object that has lists of Items?

I have a registration and there are several links, for example: public class Grupo { public string Nome {get;set;} public List<GrupoItemA> ItensA {get;set;} public List<GrupoItemB> ItensB {get;set;} public List<Grupo...
asked by 25.09.2014 / 14:25
2
answers

Create Static SelectList and pass a selected item to View

I have a question about how to send my selectList "status" to my View EditarUsuario . I've created my list with the following items: var list = new SelectList(new[] { new{ID="2",Name="Selecione"}, new{ID="1",Name="A...
asked by 02.10.2015 / 22:42
2
answers

How to receive the various fields of a view in the controller

I need to create an Insert from multiple fields at the same time! My system has multiple table and relationships and I am having difficulties at that point. I have this registration screen: Withthiscode:@using(Html.BeginForm()){<divstyle="wi...
asked by 15.10.2015 / 00:10
1
answer

List of Entity Framework attributes for entity mapping

For my Database to be outside the EF convention, and as another system already developed uses it, it is out of the question to change table / column names. I would like to know the available attributes (ex: [Key] , [ForeignKey] )...
asked by 19.10.2015 / 17:46