Most voted "asp.net-mvc" questions
ASP.NET MVC is an open-source Microsoft framework that implements the Model View Controller architecture standards for web development. Based on ASP.NET, it allows software developers to build web applications following the Model View Controller architecture standards, featuring a variety of features following recent trends.
Learn more…3,385 questions
Sort by count of
-
4
votes1
answer2820
viewsRender pages within _Layout.cshtml of other types. Asp.Net MVC 4
I’m basically developing a kind of social network, but I’m having some problems rendering pages inside my _Layout.cshtml page. Html <ul class="dropdown-menu"> <li class="header">Você tem…
-
4
votes1
answer1173
viewsLogin with different profiles
I’m developing an app for a school, where you take control of the students she has. The application makes the registration of students and registration of occurrences (suspension or warning) that…
asp.net-mvc database asp.net-mvc-5 visual-studio-2013 authenticationasked 10 years, 6 months ago Érik Thiago 2,338 -
4
votes1
answer309
viewsLock or release a controller according to some condition
I have a controller that should only be accessed if an attribute in my table is "true". Is there any way at the time the user clicks on such a link, check if the attribute is true, and only then…
-
4
votes1
answer1118
viewsDaylight saving time error (Summer time) in bootstrap-datepicker
The plugin stopped working with the start of summer time in Brazil. When I disable the option on my machine (Automatically adjust to daylight saving time) the plugin comes back to work. Code:…
-
4
votes1
answer284
viewsKnowing if a file is locked or not
How do I know if a file is blocked or not? I have perfected this code and I would like to know from you whether it is correct or for the better. Another question is if it is corrupted, the check…
-
4
votes1
answer1682
viewsHow to obtain PDF content generated by Rotary?
I am using Rotary for PDF generation from a . cshtml I can download the file through the application correctly using the command below: DadosConvite convidado = new DadosConvite(); convidado.nome =…
-
4
votes4
answers1989
viewsUpdating data with Entity framework
In the project I’m developing, MVC5, Entity 6, I’m simply not being able to update the data. The Code: zyon.TB_Cliente.Attach(cliente); zyon.Entry(cliente).State =…
-
4
votes2
answers3616
viewsHow to save the logged in user ID
I am using in my Windows Authentication application. I have a controller where the user should register their professional experiences. However, the way the application was made, I need every time I…
-
4
votes1
answer5508
viewscreate a search screen
I am giving sequence in an application in ASP.Net MVC and need to make a search screen. The question is this:: I created a table where users register their skills. I need a view where there will be…
asp.net-mvcasked 10 years, 5 months ago user11492 41 -
4
votes1
answer147
viewsHow to show the build version?
I see in some pages and systems the compilation version. I’d like to show in a view the compilation version of my ASP.NET MVC project.
-
4
votes1
answer848
viewsAutocomplete shows no results in View input
I have seen other cases in some answers here, I tried to follow the steps of other answers and did not help at all! I’m having a doubt, this is my first time using autocomplete of jquery, I’m new in…
-
4
votes2
answers731
viewsChange Context according to application
I need to point out in the web part what context the system will use. My project is divided as follows: After its completion I had to "replicate" it, but using another bank. The tables are equal…
-
4
votes1
answer241
viewsHelper for writing Htmlhelpers
I’m trying to write a Htmlhelper and seeing some basic examples I found one with the class TagBuilder that already helping: namespace MyNamespace { public static class MyHeleprs { public static…
-
4
votes1
answer611
viewsDataannotation validating property with Javascript plugin. ASP.NET MVC
I need to validate a field of my model that has a text editor in Javascript. So far so good, because the problem only occurs in the registration that I do not receive in the parameter of the Action…
-
4
votes1
answer495
viewsWhat are the positives of using Aspx View Engine instead of Razor?
When researching about ASP.Net MVC, I have always found all the examples of views with Razor (I don’t remember exactly if I saw any in aspx) and in the past I remember that it was possible to select…
-
4
votes1
answer3207
viewsHow to check if an email has been sent successfully?
I am trying to verify if an email sent from my application is successfully sent, wanting to know if the recipient receives it or not (full mailbox, invalid email, around). From what I’ve researched…
-
4
votes1
answer1208
viewsHow to print a View to a standard printer using Javascript or c#?
I need to print the contents of a view on the default printer. How can I do this using c# or javascript?
-
4
votes1
answer415
viewsDropdownlist with unique MVC values
My class Galeria possessed a foreign key with Album as there is a 1-n ratio and each photo in the item Galeria owned respectively a Album. Given this, in the CMS I created I give the possibility of…
-
4
votes1
answer275
viewsWhy use the Ienumerable?
I have the following code in a Controller: var carro = new List<SelectListItem> { new SelectListItem {Text = "Pegeout", Value = "Pegeout"}, new SelectListItem {Text = "Chevrolet", Value =…
-
4
votes1
answer357
viewsHide a column from a Webgrid
Good afternoon. I have a Webgrid and would like to leave an invisible column. How could I do that? this is the grid: @{ Layout = null; WebGrid grid = new WebGrid(Model); } @grid.GetHtml(columns: new…
-
4
votes2
answers406
viewsError Mysql Connection Asp.net MVC
I am trying to work with a Mysql database in my application. However, I am getting the following error: Keyword not supported: 'data source'. I performed all the procedures related in this question…
-
4
votes1
answer897
viewsObtain image data
My system should process some images and get key data in text. Of course, the images will follow a style pattern. Where can I start? Is there an API that can help me?
-
4
votes2
answers4228
viewsAuthentication in Restful Service
In the example below, I need to pass a login pair/password, because the REST service requires authentication (Basic Authentication). So how should I pass this information in the section below?…
-
4
votes1
answer81
viewsController and action routes in lower case
How to make the routes of controllers and actions are all in lower case? For example: instead of Noticias/Details stick around noticias/details.…
-
4
votes1
answer162
viewsProblems with logic to bring data from a list or table
I did several posts here and solved almost all problems. However I understood that the problem was in the logic that I set up to bring the result. I know I’m asking a lot, but I’m trying and I…
-
4
votes1
answer145
viewsSharepoint with MVC 5 what better way to work?
My question is which form of Hosting should I use? Provider-Hosted Autohosted Sharepoint-Hosted Application will stay on the server to be consumed by internal users and to external users. Our team…
-
4
votes2
answers1558
viewsGlobal variable query in a controller
I have a method in my controller that is called through ajax. It populates a global variable within that controller. Is there any way I can access this global variable already populated by the first…
-
4
votes1
answer600
viewsHow do I know if a client is accessing the server over the local network or the internet?
How do I identify if the client who is accessing my application, whether it is within the company (local network) or outside (internet)?
-
4
votes4
answers2257
viewsCheck if user is logged in
I would like to know how to block access when the user is not logged in to the system, however, the only page that can be accessed is the Login and when he tries to access any other page redirect to…
-
4
votes3
answers1368
viewsWhat better way to save a Group object that has Items lists?
I have a record and in it there are several links, for example: public class Grupo { public string Nome {get;set;} public List<GrupoItemA> ItensA {get;set;} public List<GrupoItemB>…
-
4
votes1
answer394
viewsCode First Table Migration - N to N using Fluent API
I have the following classes: [Table("Area_Cursos_Turma")] public class Turma { public int TurmaID { get; set; } public virtual ICollection<Aluno> Alunos { get; set; } }…
-
4
votes1
answer617
viewsValidating start date and end date for the same Model attribute
Description of the problem: I need to create a form with an initial date and end date to list sales of a product per period. Let’s take this model as an example: public class Produto { [Display(Name…
-
4
votes3
answers152
viewsViewdata error in controller
What could be wrong in this example? I can’t do it: var pessoa = new Pessoa ( PessoaId = 1, Nome = "teste teste", twitter = "@teste" ); Error message: 'Name' does not exist in the Current context…
-
4
votes2
answers1380
viewsCapture Machine Identification with C#
Good morning, I have several computers with the same output IP, how can I get any information that leads me to know which computer a request came from? I use C# Asp . Net MVC
-
4
votes3
answers3309
viewsGenerate PDF with Asp.Net MVC
Hello, in my application the reports are generated in Html, I would like to know a way to generate these Html reports in PDF.
-
4
votes1
answer937
viewsEntity Framework attribute list for entity mapping
For my sake Database be outside the EF convention, and as another system already developed uses it, it is out of the question to change table/column names. I would like to know the available…
-
4
votes1
answer4024
viewsSet the selected value in a Selectlist (Dropdownlist)
I have a list of vehicle models: private List<ModeloRastreador> modelo = new List<ModeloRastreador>(); add the result that came from the bank foreach (var m in modelo) {…
-
4
votes1
answer851
viewsHow to get the path of a file (Httppostedfilebase)?
I would like to get the path(path) from where my file is coming from. Model: [Required(ErrorMessage = "Selecione o arquivo a ser importado.")] [Display(Name = "Arquivo ")] public HttpPostedFileBase…
-
4
votes2
answers1182
viewsHow to remove mask from the field before calling the controller with Asp net MVC
In my registration form I have a CNPJ field with the mask set via jquery $("#cnpj").mask("99.999.999/9999-99"); however the value is coming in my formatted controller, in my database this field is…
-
4
votes1
answer1358
viewsCatch Penultimate record of a table with Entity Framework
How do I get the penultimate record from an Entity Framework table
-
4
votes2
answers93
viewsCheck two null fields with Data Annotation
I own two properties: public int? Inicio {get; set;} public int? Final {get; set;} Both accept null and are not required. I wanted to check if both are null using Data Annotation. The operation…
-
4
votes2
answers10482
viewsDoubt about "Error Converting data type varchar to float"
Error Converting data type varchar to float This error is occurring when performing a Update in a table, follows below the code: SqlCommand cmd = new SqlCommand("UPDATE Notas SET nota = '" +…
-
4
votes5
answers758
viewsHow to embed CSS in HTML tags?
I have a CSS file containing the following code. .texto{ Color: Red; } I have the HTML file with these tags: <html> <body> <span class="texto">TEXTO 1<span> <span…
-
4
votes2
answers1770
viewsReferencing folders created in the project
After I go to Project > Add > New Folder, rename the folder and put classes inside it I can no longer reference it in another file, for example if I would use in one controller, I would use as…
-
4
votes0
answers377
viewsSignair - C# - Real-Time Response
I’m using C#, Asp . Net, SQL Server. I have the following question, I am creating a web and mobile application to communicate with a Webapi but I came across the problem of information and/ or data…
-
4
votes1
answer169
viewsAutomate DDD
There is a faster way to create a structure on Asp.net mvc using DDD (plugin or framework)? For example, whenever you create a new entity, you need to create many files in several projects and also…
-
4
votes1
answer30
viewsUsing KEY element
In my model, I use a view that is built on the basis of certain joins of tables, which have no auto incrementable ID element. My model requires that I assign a TAG Key, however, as I have no single…
-
4
votes1
answer190
viewsAdjust height is width of Qr Coder using Messagingtoolkit.Qrcode C#
Is there any way to adjust the height is width? thanks public void GerarQrCode(string NomeImagem,string Data) { QRCodeEncoder encoder = new QRCodeEncoder(); Bitmap img =…
-
4
votes2
answers730
viewsASP.NET MVC session
Staff I have a controller where Seto two session keys and that capture those key anywhere in the application. (other controller, or a view). The controller is like this: [HttpGet] public…
-
4
votes2
answers849
viewsBest way to make class relationship
Hello, I would like to know what is the correct way to make relationship between classes of 1.. N and 1...1. Example: public class Pedido { public int PedidoID{get;set;} ............. } public class…