Questions tagged as 'asp.net'

1
answer

Use SCOPE_IDENTITY to fetch the ID of an insert

I have a user table where when adding a user I can assign several hotels, which is another insert to a table from many to many. Researching a bit I can use the scope_identity() to be able to do this since it brings me the last reco...
asked by 24.07.2017 / 23:06
2
answers

Users with MasterPage

I am trying the following: I have a Sitie1.Master with 3 related pages, and a page Default.aspx (That is not related to the MasterPage), the user puts his email in a TextBox (Login in Default.aspx ) I want that value...
asked by 07.04.2017 / 19:54
2
answers

How do I store a value of a DropDownList in a variable?

Good morning, With the following C # code, I generate a DropDownList. public void CargarViaSolicitud() { Class.EntidadConexion cnn = new Class.EntidadConexion(); cnn.Conexion().Open(); SqlCommand cmd = new SqlCo...
asked by 03.01.2017 / 14:12
3
answers

Problem with bootstrap and adding new styles [closed]

I have a project with bootstrap and I do not know how to add a new style of checkbox. I have already downloaded the files, but I do not know where to add them to the project or how to use the styles. It's in Visual studio Asp.Net     
asked by 07.10.2016 / 01:44
2
answers

Return the model class or VistaModel?

I have a design problem, I currently have a view that I only use information from my user model classe. What in the view I do not need all the information of the model what should create an extra class viewmodel with the necessary information or...
asked by 13.07.2016 / 13:14
2
answers

Update SQL Server through Visual Studio ASP.NET web forms

I'm trying to do update in a DB, but I'm not making the changes to that command. When I do it in the direct query of SQL server it works, but when I do it from my application it does not do the update . This is the query in SQL Serv...
asked by 07.11.2018 / 05:30
1
answer

Save UserID of a user logged in a specific colmna of the Data Base

I need to save the ID of the user who has logged in the column named "CreatedBy", but I can not write the correct query. Each time a "FitnessGoal" entity is created , the identity data plus the User ID will be saved in the DB: [HttpPost]...
asked by 17.08.2018 / 22:13
3
answers

preventDefault href does not work

I would like to eliminate the redirection in the a tag since currently when I click, a modal opens, but I do not want to be redirected to the browser page, I have tried with preventdefault and it does not work for me. I'm working w...
asked by 25.02.2016 / 13:29
1
answer

how can I validate a data model with mvc

Am I processing my save information through AJAX, sending parameters in a JSON string that I later get in the controller, how can I send error messages in the fields of the view that are wrong? $('#btnGuardar').click(function () {...
asked by 12.04.2018 / 01:28
1
answer

Why does not the data annotation StringLength [] and MaxValuie [] work for me?

I am having problems to implement the asp.net mvc 5 annotations. When designing my model, I put the [StringLength] annotation to validate that the user enters a minimum and maximum number of digits. It works well, but at the moment of mak...
asked by 28.05.2018 / 18:07