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
-
2
votes2
answers62
viewsPass text instead of id on dropdown
I wanted to pass the text of the dropdown to the controller(Post) instead of the id, I don’t know how I can do this. Controller: ViewBag.AnoCatequeseID = new SelectList(db.AnoCatequese,…
-
2
votes2
answers585
viewsError When Receiving POST in Paysafecard
I have a platform that makes purchases via Pagseguro form. The problem is that I’m only receiving the POST in which the StatusTransacao is as "Waiting for Payment", ie in the case of a billet…
-
2
votes2
answers515
viewsParameter query string Asp.net MVC
I need to avoid in ASP.Net MVC that a user simply changing the page URL has access to other data. Example, it can access the page www.dominio.com.br/usuario/1 and I need to block him from simply…
-
2
votes2
answers539
viewsContext Dispose should be used in ASP.NET MVC?
In the Web Forms every time I’ve assembled some kind of CRUD, used the using to make an implicit Dispose(). public List<Produtos> Lista () { using (var ctx = new DbContext()) { return ctx.…
-
2
votes1
answer153
viewsReturn data from a table in Web.config
I develop an application, which will be implemented in several companies, and we will need to make changes to the connectionString in each of them( because they already have servers installed, with…
asp.net-mvcasked 9 years, 10 months ago Randrade 21,612 -
2
votes1
answer177
viewsAutomatic email sending from a website
I have a hosting and my site is already in the air, I wonder if it is possible to schedule the automatic sending of email at a certain time, through the site. I’m programming in aspx
-
2
votes1
answer440
viewsHow to get the value of a UF list through the ZIP Code query via Ajax?
I am developing an address form where the user type the zip code and automatically fills other fields, via Ajax. The problem is I can’t get the value of UF, which in my case is a list. my example…
-
2
votes1
answer114
viewsNumbers and Percentage in string C# MVC
My string is not coming with strange characters, it is coming with numbers and percentage. Example: "[email protected]" stays "teste%40test.com" or "fictício" stays "fict%C3%ADcio"…
-
2
votes1
answer2251
viewsMVC or SPA app
I have been working with MVC for the last two years, but lately I have been following the growth of SPA applications. After reading several articles on this subject I had a question, if I want to…
-
2
votes1
answer58
viewsError logging data in Viewmodel
Have that question where I did according to the answers, my logic... Only now, when registering the data, an error was generated. This error refers to a view property that cannot be null, which is…
-
2
votes1
answer51
viewsHow to stay with the selected item in a select after page transition?
What are the best ways to stay with a selected item in a select after page transition (Go to a page and then return with the already selected fields) using ASP.NET MVC? Session? Cache? Tempdata?…
-
2
votes1
answer217
viewsCorrect way to update a Model from a Viewmodel
I have the following question: do I get one Viewmodel in the Controller of ASP.NET. In the update method I have two options: 1st option : transfer the Viewmodel to the respective bank entity…
-
2
votes1
answer2651
viewsChanged RU context, but without updating database structure
I’m using the free hosting service from mee on a free plan. So far so good, everything worked out in a good. But after I made some changes to my database, their database just doesn’t work, it keeps…
-
2
votes1
answer334
viewsWhy are you saying this object is null?
papelX.moderador = abc.Id; papelX.participantes.Add(abc); I’m finding a NullReferenceException in that code above. I’m creating an object papelX and I will use some properties of the object abc.…
-
2
votes2
answers733
viewsFormat string in View
Is there any way to format a string (returned from a query) directly at View, to show the first uppercase letter and the rest lowercase? Ex: In C# I can use Textinfo.Totitlecase for that reason.…
-
2
votes1
answer171
viewsDelete Devexpress controls
I need to remove Devexpress controls from a project due to owning these components and not having the software license. I already deleted the components and references but when trying to compile…
-
2
votes1
answer709
viewsSet time zone for the whole project
I recently hosted an application on a North American server, so the dates are outside the Brazilian time zone. In this way, I would like to know if there is a way to define the time zone once so…
-
2
votes1
answer2976
viewsHow to clear form data after saving to database? via Ajax . net mvc
after saving an object in the database, the view continues to show the fields filled! <fieldset> <legend>Endereco:</legend> @Html.ValidationSummary() @Html.HiddenFor(e =>…
-
2
votes5
answers17869
viewsHow to align the Left fields of an Html table?
I cannot align my Labels (Razor) to the left of my html table with Visual Studio! <table cellspacing="6"> <tr > <td > @Html.Label("Cep: ") </td> <td >…
-
2
votes1
answer1070
viewsSecurityexception - Permission Error
Hello, I am climbing an application in my Locaweb hosting and I got stuck in this error, someone knows how to solve this permission problem ? [SecurityException: Request for the permission of type…
-
2
votes1
answer839
viewsASP.Net and C# - automatic e-mail sending
On the site I took over from a client, developed in ASP.Net with C#, there are registered employees with a defined admission date. The registration of these employees is in an SQL Server 2008…
-
2
votes1
answer1204
viewsQuery with parameter passing in a Url.Action
I have a controller that gets an ID and makes a listing, plus on this page I have a button to return to the previous page, so as it also gets an id, so how could I pass this id dynamically? Here I…
-
2
votes3
answers10463
viewsHow to use @Html.Radiobutton, how to send the selected option to the controller?
I’m trying to send the selected option of Radiobutton to the controller, I’ve tried to do several ways, I’ve searched several places and I don’t have a solution. Thanks Index @model…
-
2
votes2
answers63
viewsIs it possible to insert the character '#' (hash) in the MVC routes?
It is possible to insert the character # (hash) on MVC routes? I am developing an MVC application in which one of the specifications is the use of # on the MVC routes. Is it possible to do this…
asp.net-mvcasked 8 years, 3 months ago Matheus Bessa 1,261 -
2
votes2
answers1688
viewsDisplay control in Partial View conditionally
I need a control of a Partial View is displayed according to one condition. For some views a button would appear for others not and this would be set through a parameter in the call of Partial View.…
-
2
votes1
answer768
viewsHow to send an object ID in jQuery autocomplete?
I need the ID of the selected item in the jquery Autocomplete, when selecting the item by autocomplete, send the ID of the selected item to the form. On the label Text when sending the item ID via…
-
2
votes2
answers133
viewsServer changes no effect
I have an application running c# with . net 4.5 on IIS 8. I’m editing a Controller (which is a .Cs file). However, I edited some things in this Controller and saw that these changes were not…
-
2
votes2
answers291
viewsHow to standardize Datetime format for all type fields without using Displayfor or Editorfor in MVC?
In many cases in the application we have to use something like: @Html.Raw(item.data.ToString("dd/MM/yyyy")) can’t be DisplayFor nor EditorFor in no case and we have to show the Brazilian date…
-
2
votes1
answer49
viewsid3 display album image in mp3 file using c# mvc Razor
I’m building an application in C# and ASP.NET MVC and Razor that reads data from mp3 files, but I can’t display the album image. I have tried several available libraries, I extract all information…
-
2
votes1
answer118
viewsHow to work with @Html.Dropdownlist?
Friends After following the example I made the adjustment in the code, I am not able to send the information to Actionresult @model ProjetoDelphiMobile.Models.cliente @{ ViewBag.Title = ""; }…
-
2
votes2
answers4895
viewsPass parameters to the Controller via @Html.Action
I need to render one View into another, but this rendered View needs to receive and display data from the database, so I’m going to use @Html.Action for this, but I need to pass a parameter to the…
-
2
votes2
answers422
viewsApplication server
The client has no server (Windows Server or Linux) and does not want to host the system in a data center or in the clouds for example, and you want to use the system on an intranet. Currently 3…
-
2
votes1
answer88
viewsReturn from a Windowsservices via an ASP.NET application
I have a Windows Service which at a certain time scans the machine and performs a backup, to a folder on a server on the network. The Service is running on the machines perfectly and running the…
-
2
votes1
answer640
views@Html.Actionlink submitting Post MVC form
@using (Html.BeginForm("MinhaAction", "MeuController", FormMethod.Post )) { <div> <table> <thead> <tr> <th>Empresa</th> <th>Cliente</th>…
-
2
votes1
answer266
viewsHow do I use an existing database in an ASP.NET MVC C# and Identity application?
I need to authenticate users. So I created my database with all my business rules, connected to the ASP.NET MVC application, and started programming. Now, when I went to do the login user realized…
-
2
votes1
answer541
viewsWhy isn’t my CONTROLLER picking up VIEW fields?
I am making a form in the VIEW, but the fields where I use radio and select(option) are not passing their values to the Controller. If anyone knows why. My view: @model…
-
2
votes1
answer45
viewsSystem.Invalidoperationexception Database Opening Error?
I am using webMatrix, to develop an example in Jquerymobile, I am having the following error @{ Layout="~/shared/_Layout.cshtml"; Page.Title = "Home"; Page.Header = "Categorias"; var db =…
-
2
votes2
answers743
viewsReceive by parameter a List of miscellaneous objects
I have the following problem described in the comment: public class Funcionario{ public long Id {get; set;} public string Nome {get; set;} public DateTime DataContrato {get; set;} } public class…
-
2
votes2
answers576
views@If inside a <body> tag
How to put a condition if within a tag <body>? While trying to make: @if (Request.Path.Substring(Request.Path.LastIndexOf("/") + 1).ToLower() == "default") { <body class="home" } else {…
-
2
votes1
answer911
viewsProblem when deleting image
I have an image that is my user’s avatar, then I need to delete and I have the following code snippets: Action that is used in file import public void MinhaActionParaImport() { var arquivo =…
-
2
votes1
answer66
viewsHow to register dependencies with Windsor that are in different layers of the application?
How to register dependencies with Windsor that are in different layers of the application? I don’t want to keep referencing all layers of the application in the presentation layer as most do around.…
-
2
votes1
answer763
viewsDisplaying Modal with model passed inside a C# Asp.net MVC foreach
I have a main page containing a list of users. In this list of users I have a button on the side where I will click and display a modal, passing the model of that line I clicked. I managed to do it…
-
2
votes1
answer1172
viewsConfigure routes using areas in ASP.NET MVC 5
I am trying to set a route using area as follows: At Routeconfig.Cs public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) {…
-
2
votes1
answer481
viewsAjax.Beginform returning Partialview as View
Goodnight! I’m working on a Bed Management project. In a particular View, I am displaying the registered Wards, and for filtering purposes, a field where one can research by the name of the…
-
2
votes1
answer52
viewsWhat am I doing with this method?
I have the following method: [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> Criar([Bind(Include = "CategoriaId,Nome")] Categoria categoria) { if (ModelState.IsValid) {…
-
2
votes1
answer74
viewsAttach many objects with id = 0
Good morning Personal, In my system here at work I have the following architecture: A PROJECT (which has some information) is composed of several PARTS. The parts are very different from each other.…
-
2
votes1
answer92
viewsHow to bar the registration of an already registered user
I am developing an application that manages Courses in Asp.net MVC, I’m still a beginner, and I’m trying to do the following: The Student has a screen where he lists all the courses for him to…
-
2
votes2
answers179
viewsPhoto saved in Directory does not appear in Solution Explorer
After a lot of pain, be able to save the photo in the directory and not in the bank. However it does appear on my tablet there in my Solution Explorer, more when opening the photo by windows explore…
-
2
votes2
answers1229
viewsScroll through a table (grid) Razor MVC
I have a table that is filled by a Model in HTML Razor in a partialView, a field of that table I left as editable using the @Html.TextBoxFor. After the user edit this field need to update in DB, but…
-
2
votes1
answer512
viewsNotifications with Signalr
I want to create a notification system in my web app (MVC) using Signalr 2. When someone in the app does a certain action some users (not all and not always the same) should be notified. Something…