Questions tagged as 'asp.net-mvc'

2
answers

How to render html passing as controller string to the view?

I have the following view: public ActionResult RelatorioEquipe() { ViewRelatorioEquipeDTO dto = new ViewRelatorioEquipeDTO(); dto.LstUnidadeGerencial = negocio.Relatorio.ObterLstUg(); dto.LstExercicios = new Exe...
asked by 04.06.2014 / 22:54
1
answer

How to make a pager without a gridview? [duplicate]

I have a system in asp net mvc, in one of the screens is displayed several items, the select to get them from the bank is: Select top 20 from Produtos As shown, it displays only the first twenty products. The products are rendered inside...
asked by 10.07.2014 / 22:16
1
answer

Difficulty with debugging MVC code

One of the problems I have had in studies is how to debug the code in mvc, I can not find a logic to solve this. NOTE: The code sample option is not formatting the code correctly. The image upload option is having problems, it only send...
asked by 03.10.2014 / 21:56
1
answer

Default Asp.net MVC Authentication

I am starting studies on ASP.NET MVC, and wanted to know where the visual studio creates the database and tables when choosing the default MVC project. It seems that it already creates all the support for registration and login. Where are these...
asked by 13.10.2014 / 14:24
1
answer

Make a foreach that does not repeat the same data

I have this foreach, in a table with more than 5000 records. There are only 6 types of business unit. I would like in foreach and linq, when a type of un appears, it loads and then no longer repeats it, ie, it loads another different one and so...
asked by 22.09.2014 / 16:50
1
answer

___ ___ erkimt Error adding HttpPost the controller ______ qstntxt ___

I have a problem in time to add the attribute %code% on my controller. I mean, I can add the attribute without problems, but when I compile and go to the form registration I just can not access.

I get the following error:

  

Server Error in Application '/'.

     

Can not find the resource.

     

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could not be removed, had its name changed, or is temporarily unavailable. Examine the URL and make sure that it is spelled correctly.

     

requested URL: / User / add

Version Information: Microsoft .NET Framework Version: 4.0.30319; ASP.NET:4.0.30319.33440

Also, when I take %code% % attribute, I can not see the registration form, but I can not do the insert in the bank.

    
______ ___ azszpr31034

When you add the HttpPost attribute in an action. It can only be accessed via the HTTP POST method.

If your intention is to only display the form. Do not decorate your method with no attributes, the default is GET.

What you can do is set an Add method with no attribute. This method will be accessed via GET and display the form.

Then you create a second method, for example AdicionarConfirmado, decorated with the attributes and HttpPost ActionName="Add"

The methods can no defined as follows

%pre%

Since your form that will save the record would look like this:

%pre%     
___

I have a problem in time to add the attribute [HttpPost] on my controller. I mean, I can add the attribute without problems, but when I compile and go to the form registration I just can not access. I get the following error:    Ser...
asked by 01.09.2014 / 04:06
1
answer

Two types of searches in the same textbox

I would like to know if you can search two types of variables (one at a time) in a single textbox. Example: public ActionResult Index(string pesquisa) { var usuario = from u in db.usuario select u; if (!String.IsNul...
asked by 04.09.2014 / 04:08
3
answers

Receive one Model per parameter in a function

I'm trying to get a Model in a function, which passes from a view (although I do not know if it's possible) to be able to generate a list and generate a PDF. My View : @model List<BDOleoTorres.Models.AutoDeclaraco...
asked by 26.03.2014 / 12:21
1
answer

Controller and View Structure

An aid to not doing something much more laborious than it can be soon of face. I have the following classes in my Model : public Pessoa { public int Id { get; set; } public int TipoPessoaId { get; set; } public string Nome { get;...
asked by 31.03.2014 / 20:43
2
answers

How to make the server return a page without the browser request

I have a registration screen that must be validated by several business rules, when the user submits the submit I wanted to leave a page with a message, for example, "Validating, please wait". I tried doing this with asynchronous delegates, I di...
asked by 29.09.2014 / 16:23