Questions tagged as 'c#'

1
answer

How to make a personalized data annotation?

I need to validate the routine (Chilean ID) that is entered in a form, for this I am using asp.net mvc 5, but I do not know how I can create my own validator for this data. Can someone help me or guide me on how to create this validator?    ...
asked by 25.05.2018 / 21:33
1
answer

How do I manage to copy all rows of a datagridview in c # into a single text file?

I have a problem with my program. I need to make that when I copy all the rows of the DatagridView store them in the same file and display them in the order that they are in DatagridView , please I need your help. I share the code b...
asked by 24.05.2018 / 07:39
3
answers

reading of the first two characters

I am taking the reading of a scaner in a textbox but I need to make a function that only allows the scans that start with "3S", otherwise it tells me error. I use this method which I only declare within the event TextChanged of textbox1...
asked by 24.05.2018 / 13:46
1
answer

Generate model for the response of an api

At the moment of consuming an api, the next response returns. [ { "MiKey": 0000, "MiKey": 02, "MiKey": "CADENA", } ] Fictitious data My Model: public class RootObject { public int MiKey { get; s...
asked by 24.05.2018 / 12:54
1
answer

How to get the label number one or an xml file in c #?

What I want is to get the children of my tag videos, which in this case would be Mathematics, but when I execute my code c # I get the children of my Mathematical tag, what is being Tema1. <?xml version="1.0" encoding="utf-8"?> <Video...
asked by 28.05.2018 / 20:39
1
answer

C # Razor HTMLHelper Dropdown

Friends I'm doing a drop down list with Razor and I'm trying to get the drop values, but I only get the name that I put in place of their values someone could guide me or tell me where I am wrong? [HttpPost]...
asked by 17.05.2018 / 16:22
1
answer

login and security menu by roles

I have a Project with a web-form called login and a master.page called menu, also a series of tables where I have roles, users and page names, I would like to be able to do when I log in and enter the credentials according to the role to appear...
asked by 25.05.2018 / 03:06
1
answer

Event Click on Li Html

I have this code in Html <li class="active"> <a href="#homeSubmenu" data-toggle="collapse" aria-expanded="false"> <i class="fa fa-truck"></i>...
asked by 17.05.2018 / 04:02
2
answers

urls on asp.net mvc 5

Can you leave the urls of my web application in the following way? Example: Normal url - > localhost/MiControlador/MiAccion Url converted - > localhost/mi-controller/mi-accion or localhost/MiController/mi-accion...
asked by 16.05.2018 / 13:39
2
answers

ASP.NET Save file in a folder

Hello friends I am trying to save a file inside a folder that I create dynamically, up to here there is no problem, the point is that when I try to pass the file already in my method I receive it Like Null , could someone tell me where I'm mi...
asked by 16.05.2018 / 19:04