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
-
1
votes1
answer1377
viewsLinq with 2 different context using Inner Join
I would like to make a query in 2 different databases (2 Dbcontext) I tried it in several ways, one of them: I make a prequery in Dbmega context to recover the employees var FuncionariosLinq = (from…
-
1
votes1
answer19
viewsUpdate a label with dropdown text
On my label appears all groups: ABC There should only be one group chosen by the dropdown, Example: To JS: $("#GrupoID").change(function () { document.getElementById("grupoupdate").innerHTML =…
-
1
votes2
answers1714
viewsSend a list of data in a viewbag and receive in a foreach in the view
The query data is correct, but I cannot return the data to the view. Controller: var disponib = (from d in db.Disponibilidade join c in db.Catequista on d.CatequistaID equals c.CatequistaID where…
-
1
votes1
answer41
viewsGive preference to results that have the parameter passed in the Entity Framework
I am trying to implement a data solution that displays first the values that have the parameter passed to then pass the other parameters. Example: In a product table has the following data:…
-
1
votes1
answer87
viewsData Annotation - error ratio 1:1
I’m trying to make a 1-to-1 relationship. Apparently it would be something simple but my system is getting lost in this relationship; It doesn’t make a mistake, but the relationship is wrong: Model:…
-
1
votes1
answer928
viewsHow to treat a decimal field with no homes after comma in a jquery mvc c#mask
I have a model with the following definition: [Display(Name = "Quantidade / Volume:")] public Int32 RoQuantidade { set; get; } In my View to fill the data when empty, that is, that have not yet been…
-
1
votes2
answers250
viewsObject error not instantiated
I have a model calling for ClientesModel. Inside it I have the fields: public int id { get; set; } public int codcli { get; set; } public string nome { get; set; } public string endereco { get; set;…
-
1
votes1
answer499
viewsForm validation with MVC Dataannotations
I’m trying to validate forms with use of Dataannotation, I tried direct on model or in my viewmodel and none of them works. View Model: public class CieloViewModelTransacaoPartial {…
-
1
votes3
answers2378
viewsSend a List<T> with multiple items to the controller
Well, I’m facing the following problem in a project I’m working on: how to pass a list (List) with approx. 500~1000 View lines for the Controller? Actually, this list of mine has a field called…
-
1
votes1
answer63
viewsView inside an area as default in MVC
How can I make a view inside an area the default when running the application? Error I am getting: My structure: My file Routeconfig What I did below didn’t work. namespace WebApplication1 { public…
-
1
votes0
answers24
viewsReturn an array of values from checkboxes to the controller
I have a problem returning values from my checkbox list, the "checkedcatechesis" array does not reach my controller. Script: <script> $(document).ready(function () { $('[key]').change(function…
-
1
votes3
answers236
viewsCompare two querys
I have a query that returns only the catechisms that went to the event: var catequizandosCheked = (from cat in db.Catequizando where cat.Eventos.Any(e => e.EventoID == eventoID) select new…
-
1
votes1
answer177
viewsSearch box ASP . NET
I’m having doubts in the creation of an item search box. I already say that I’m a beginner. I want when the user type a name in the search box to appear the items that contain the name that the user…
-
1
votes1
answer38
viewsDoubt about entities Asp.net mvc
I have 4 tables: T1, T2, T3 and T4 and the table of Customers. What happens is that the tables T2 to T4 "should" be one. But as part of the data would be as if it were a table and its options, I…
-
1
votes2
answers85
viewsUnsaved relationships
Have that question where thanks to the help of colleagues I managed to resolve my situation. Well, at least in parts... After making the adjustments pointed out, the data is being saved. But the…
-
1
votes2
answers258
viewsHow to compare with Guid Mvc
Hello, I would like to make this comparison using a Guid, public Guid ClienteID {get;set;}. This code works using a int, I make a if, if my ClienteID == 0 I save, and if it doesn’t equal 0 I change.…
-
1
votes1
answer75
viewsHow to use 4 model in a view
Hi, I’m 4 class Cliente, Locacao, Item and Cacamba: public class Cliente { public Guid ClienteID { get; set; } public string Nome { get; set; } ............... } public class Locacao { public Guid…
-
1
votes1
answer334
viewsAmbiguity error after changing Resource (ASP.NET)
I have been working on an ASP.NET MVC project for months. It is a system available in English and Portuguese, English being the default language. I do this through the use of Resources, and it was…
-
1
votes1
answer106
viewsDoubt with angular and checkbox
I have a form with some inputs and some checkbox, when I do the search in the database is returned Json, and input fields are filled in but checkbox are not marked although I have declared the…
-
1
votes2
answers137
viewsGetting registration id
I have a table with multiple records and a link to delete, how do I click this link to pass the id value of the record I want to delete ? Code from my view: @model…
-
1
votes1
answer95
viewsPopular table with api Fluent
I have this model Many to Many and need to popular the table through the file Seed as described at the end of the post using the api Fluent Context file: public EfDbContext() : base("EfDbContext") {…
asp.net-mvcasked 8 years, 5 months ago hard123 2,329 -
1
votes2
answers353
viewsEntity Framework search as case sensitive
People I am using Entity Framework 6, Mysql, ASP.NET MVC. The problem is this: when I do a search through the form (my search view) EF is case sensitive. When I do the query directly in Mysql, using…
-
1
votes1
answer209
viewsPassing as parameter a generic type in an attribute in . NET MVC
In another question I asked here I had to modify my authentication class to return the values of the model referring to the user and the authenticated user type, for example, admins, users, clients,…
-
1
votes1
answer118
viewsHow to create a method that takes only one string and returns a generic type? . NET MVC
How could I create a method that doesn’t need to receive a type as a parameter, just a string, but would return a type? For example: public static T Guard(string guard_name) where T : class, IAuth {…
-
1
votes1
answer158
views.Orderby dynamically in Lambda
I have a field int called OrdemDosProdutosDestaque where I store products order preference (My customer choosing and storing in the database). ex: 1=Aleatório 2=Preço 3=Referência 4=Categoria etc..…
-
1
votes1
answer152
viewsButton with link on MVC5 is not working
I created a popup in a project mvc5 (Razor) and it is not working the link that when clicked on the button would go to another page but is not working I will post the code here below. Code : <div…
-
1
votes1
answer254
viewsHow to create subscription in Asp.net with pagseguro
Hi I already searched everywhere and I couldn’t find how to integrate a subscription inside my system in Asp.net mvc with pagseguro. I used this code and my return is not working when I add this…
-
1
votes1
answer126
viewsASP.NET MVC Default Page
Guys I have an ASP.NET MVC app with FormsAutentication and I’m having a hard time leaving a controller as home page. I have already released on web.config, but it still doesn’t work. The controller…
-
1
votes1
answer764
viewsASP.NET MVC error when displaying date and time fields in View
Hello I’m having some problems presenting at View. In the database I have this data recorded: Starting date: (datetime) 1998-11-16 00:00:00.000 Date: (datetime): 1998-11-16 00:00:00.000 Time entered…
-
1
votes1
answer34
views@Html.Action in _Shared error when sending a Viewmodel by Controller
In my _Shared have a Partialview calling for _rodape.cshtml but now she will need to receive a Viewmodel which will have various data. Like I don’t want to create a Action in each Controller, I…
-
1
votes1
answer308
viewsCharset problem between Asp.Net MVC with Entity Framework and SQL Server
I’m having a problem that all the values that come from the bank SQL Server, are having accentuation problem. When written words are directly on HTML, does not give this problem. What is strange is…
-
1
votes4
answers1566
viewsASP.NET MVC input number
I’m trying to use a input with type=number, but in Chrome is giving that the value informed should be a number. The problem is the state model that is returning invalid, because when giving the…
-
1
votes2
answers672
viewsHow to pass a Ienumerable Model to a Controller?
I have a page that correctly lists my records. Plus I have a Html.BeginForm for each line, @model IEnumerable<Generico.Dominio.TB_POSSIBILIDADE> @{ ViewBag.Title = ""; } @if (Model.Count()…
-
1
votes1
answer31
viewsDoubt with Routes in Asp.net mvc
When creating a Controller a : public ActionResult Index() { return View(); } But in this Controller, if you have a new Action if a parameter is required, if the user tries to open this link it will…
asp.net-mvcasked 8 years, 3 months ago Harry 3,805 -
1
votes2
answers963
viewsImages do not appear on the website posted on the web server
Good afternoon, you guys, I published a website on the WEB server, but no image is being displayed in the browser. All images are displayed this way: <img src="~/imagens/logo.png" Local displays…
-
1
votes1
answer42
viewsDoubt with Handleerror Asp.net mvc
I am searching for a way to avoid an error message when user happens enters for a page that needs a parameter: namespace Projeto.WEB.Controllers { public class ModalidadeController : Controller { //…
-
1
votes1
answer160
viewsReturn with multiple json with jquery . net
I need to return to ajax a json, or rather several json, being city,neighborhood,state,parents, each being a json in the same method, however as not possible to make several return put the list of…
-
1
votes0
answers354
viewsError connection with Postgresql
I’m having trouble connecting an Asp.Net MVC application with Postgresql (Ocaweb). error: 28000: no pg_hba.conf entry for host "187.52.54.50", user "dadosportal", database "template1", SSL off…
-
1
votes1
answer588
viewsIs it possible to leave connectionString dynamically?
I’ve read something and I know it’s possible to leave one connectionString dynamically in an ASP.NET MVC application. However, it is possible to create n connections where each authenticated user in…
-
1
votes1
answer95
viewsLinking Users to Businesses and bringing related records to the User’s company using ASP.NET Identity and Entity Framework
I have records in the database (example, clients), and in all records have an identifier EmpresaID. I’m using identity with Entity framework to authenticate. In the user’s registration I have an…
-
1
votes1
answer54
viewsHow to use areas only using root controller
I created an ASP.NET MVC 5 project where I had done one template, so now we’re going to have several templates divided by areas. Only that the controllers will be the same, so I didn’t want to…
-
1
votes2
answers447
viewsReturn function Boolean via ajax
I have the following ajax call on my page: $.ajax({ url: 'EquipamentoTemControleFuncionamento', data: { contratocod: contratocod, numeroserie: numerodeserie }, type: 'POST', dataType: 'JSON',…
-
1
votes1
answer355
viewsDoubt : Search with Dropdownlist mvc 4 Razor Asp.net C# sql Server
I’m having difficulty in popular dropdown with sql server, because it comes repeated sql item ... ex: when I select cities it comes with repeated cities and so on, and I can’t direct to search page.…
-
1
votes1
answer187
viewsConfigure Route MVC page
I have a website and when entering the home page it is redirected to another view. Thus: www.exemplo.com redirects to www.exemplo.com/Home/Hotsite That’s because I have a feature that when entering…
-
1
votes4
answers2259
viewsHow to display a Javascript message in an Asp.net MVC view?
I have this code: @if (!string.IsNullOrWhiteSpace (Model.ErrorMessage)) { <Script> $ ("#ModalError').modal.('show.'); </Script>…
-
1
votes1
answer425
viewsProblem when displaying modal bootstrap
I am trying to display a modal of bootstrap to the client, with an error message, my code is as follows: @if (!string.IsNullOrWhiteSpace(Model.ErrorMessage)) { <script>…
-
1
votes1
answer150
viewsCustomizing width of Textboxfor
How to change the size of Textboxfor ? I followed exactly this solution and had no effect on my form: [How to Set a Larger Size for a Textboxfor Bootstrap CSS file is being loaded first; HTML:…
-
1
votes0
answers45
viewsGenerating two Checkbox tags being a Hidden in Aspnet MVC
Goodnight @Html.CheckBox("Agree", new { value = false, @class = "filled-in", @id = "filled-in-box" }) When I Checkbox in Aspnet, by the above command, it is generating me two Tags being that one is…
-
1
votes1
answer114
viewsEntity Framework (ORM) and Dropdownlist Html
Have two models we map that will work like this : The model Afazer will have a Combobox(Dropdownlist) which will make available the categories for the user to select, but these categories are…
-
1
votes1
answer154
viewsDoes not send email password recovery by Sendgrid
I implemented a class for sending password recovery email, but the email is not sent. Class code sends email: public static Task EnviaEmail(string email, string assunto, string mensagem) { var…