Questions tagged as '.net'

2
answers

Why only one Encoding works in the algorithm?

It is as follows: I have an encryption module that encrypts a byte[] and exits another encrypted byte[] , and at the end of the output a checksum is placed; the checksum is a single byte generated by the application made by the asymm...
asked by 27.07.2017 / 05:53
3
answers

Persist information using ViewBag?

I have my login screen and want to show the name is the user id logged on another screen, so I can use this information. In my controller : [HttpPost] public ActionResult Index(TB_USUARIO model) { //aqui vai pesquisa...
asked by 28.12.2015 / 18:16
2
answers

Null parameter in route

I'm trying to get into a controller , get a parameter and print it in the View by a ViewData or ViewBag . My Controller: public ActionResult Index(string information) { ViewData["Bag"] = information; return...
asked by 26.01.2016 / 16:22
3
answers

Call a form and close a form in the same event

How do I call a form and close a form in the same event. For example: private void iniciar_Click(object sender, EventArgs e) { Close(); Frm1 newForm2 = new Frm1(); newForm2.ShowDialog(); }     
asked by 12.03.2014 / 04:50
2
answers

Access object attribute passed as generic parameter

In my application I have a chained list class that receives a generic parameter, which will be the type of value that the list will save. In this case, which I am passing as a parameter to the Usuario class, I need to check if there alrea...
asked by 15.11.2018 / 13:33
2
answers

What is a literal?

In this link of the MSDN site says that a literal is:    A literal is a value that is expressed as itself instead of as a variable value or the result of an expression, such as the number 3 or the "Hello" string. I still do not understa...
asked by 22.02.2016 / 01:12
2
answers

Any ASP.NET MVC solution for SQL injection?

I have in the application a code that validates the data entry, adjusting according to what is needed, would this be considered a good or a bad option? public static string ValidaDados(string str) { //Função simples para evitar at...
asked by 14.02.2017 / 13:10
2
answers

Rename error message

Next model : [DisplayName("Data:")] [ValueParser("ptdateparser")] [AssertThat("DeadLine > Today()", ErrorMessage = "* Data deverá ser superior a data de hoje")] [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/mm/yyyy...
asked by 12.07.2018 / 01:27
2
answers

Is it wrong to put that amount of code in a button click event?

Is it wrong to put that amount of code into a button click event? private void CPeBTNSalvar_Click(object sender, EventArgs e) { try { if (CPeTBCodigo.Text == "") { throw new ExcecaoM...
asked by 22.07.2018 / 22:08
3
answers

Capture selected value in grid checkbox

Hello, I have the above form where it shows all the products that I have registered in my database and presents in a Gride. I placed the checkbox inside this Gride. I would like you to only record items that are checked out of the check...
asked by 20.10.2015 / 03:32