Questions tagged as 'asp.net-mvc'

4
answers

Return True or False in jQuery Success

< script type = "text/javascript" > $(document).ready(function() { $('#btnEnviarDados').click(function() { var strFomr = $("form").serialize(); $.ajax({ url: $("form").submit(), type: "POS...
asked by 07.02.2017 / 01:48
1
answer

Display or Hide Fields for Individuals or Companies

I have a form that registers Customers, and has the option of being an Individual or Legal Entity, each of which has a few different fields. I thought about using an @Html.RadioButton with the option Individual and Corporate. When you click o...
asked by 07.09.2015 / 23:22
2
answers

Saving an attribute for image [closed]

I need to save an image and let's say I have something like: namespace Projeto.Models { public class Usuario { public int UserId { get; set; } public String Nome { get; set; } public ? Foto { get; set; } }...
asked by 06.01.2016 / 20:47
4
answers

How to display a JavaScript message in an ASP.NET MVC view?

I have this code: @if (!string.IsNullOrWhiteSpace (Model.ErrorMessage)) {      <Script>          $ ("#ModalError').modal.('show.');      </Script>      Response.Write("<script>alert('Olá');</script>");      HttpContex...
asked by 15.09.2016 / 20:20
3
answers

sending email by smtp

I made a class that has the following code to send an email: try { WebMail.SmtpServer = "smtp-mail.outlook.com"; WebMail.SmtpPort = 25; WebMail.EnableSsl = true; WebMail.UserName = "meuem...
asked by 30.06.2016 / 06:40
3
answers

Is it possible to add connection string within a class?

I have a project of type class library where I have my Context, in it I get the SQL connection that is in my web.config . How can I add the SQL connection so that it stays inside the DLL? I want to pass the direct connection here, w...
asked by 05.07.2016 / 21:19
3
answers

Asp Net MVC pass connection string to access layer

I have a project that is divided into layers, BLL DAL and UI, in the UI is my MVC project, however the need arose on the login screen the user choose the connection string, how can I pass this string from the MVC project for DAL and continue to...
asked by 19.02.2016 / 19:45
3
answers

Reports in C # MVC [closed]

How do I report to c # ? Do I use a third-party component or do I make an HTML page? What do you use on a day-to-day basis? I ask, therefore, I need to print reports that follow a government standard. In delphi I do with my feet in...
asked by 26.03.2014 / 12:06
1
answer

How to set the Index of a List to start at 1 instead of 0 when populated

Whenever I populate a list in C #, as in the example below, as I add items, they are arranged starting from position 0 in index . If I add 5 items to my list, I will have 0, 1, 2, 3, and 4 positions. I need to make index start with 1 and get i...
asked by 26.10.2018 / 00:43
2
answers

File txt opens in the browser instead of being downloaded

I use the following code to generate a txt file and send it to my View : public ActionResult geraBpa(){ var caminho = System.Web.HttpContext.Current.Server.MapPath("~/Content"); using(StreamWriter file = new StreamWriter($"{cami...
asked by 22.08.2017 / 19:58