Questions tagged [model-view-controller]

Model–View–Controller (MVC) is an architectural pattern, introduced in mid 1970-s in PARC into how to compose software interfacing also with user-interactions. For Microsoft ASP.NET MVC, please use [asp.net-mvc] or [asp.net-core-mvc] tag instead. For Spring MVC, please use [spring-mvc] tag instead.

model-view-controller
Filter by
Sorted by
Tagged with
1 vote
3 answers
2k views

Enumerable.Range to pull months back dynamically

I'm working on an MVC framework report where we are trying to restrict the users to two years of data (from today's date). Per their requirements, we have a month and year dropDownList and the users ...
TrevorGoodchild's user avatar
0 votes
1 answer
402 views

How to know which field is to update in a MVC view?

i am working on a Java Swing Application that uses the MVC Design Pattern. The Main View has a Model associated with it, where the program logic is done. Via setChanged() and NotifyObservers() in the ...
Martin's user avatar
  • 11
0 votes
0 answers
120 views

When I try to set UILabel.text, I get error "unexpectedly found nil while unwrapping an Optional value" [duplicate]

I set my UILabel.text in storyboard : But when I try to update the value in my ViewController.swift: @IBOutlet weak var scoreLabel: UILabel! func scoreDisplay(score:Double) { print(...
123's user avatar
  • 8,853
2 votes
1 answer
824 views

EF5 "the selected stored procedure or function returns no columns"

I am using EF 5 and this is my SP USE [MYDatabase] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[SP_FirstAttend] @serviceStart date, @serviceEnd date AS BEGIN SET ...
Arpan Shah's user avatar
-1 votes
1 answer
114 views

Cannot use inheritance in MVC, PHP

please help me with the following issue. I got DefaultController with DefaultModel : Class DefaultController { public function __construct(DefaultModel $model){ $this->model = $model; ...
Alexandr's user avatar
0 votes
2 answers
86 views

Lines of code duplicated in Controller, where to create a method with them?

Aloha, I have two methods in my Controller, one for setting the profile picture and the other for updating it. I'm using this lines of code in both methods: $user = Auth::user(); if (Input::...
therealbigpepe's user avatar
0 votes
1 answer
622 views

AngularJS ASP.Net MVC: Interaction between Treeview and Grid on the same page

I am using AngualrJS with Devextreme controls in ASP.Net MVC project, i have a page which contains a treeview (populating Folders) and a grid (populating folders and files in the selected node in the ...
Hussein Salman's user avatar
0 votes
1 answer
156 views

ASP MVC access Httpcontext from Areas

I'm trying to implement the concept of module in my ASP MVC application through Areas. I added a project named TimeSheet (I say it just as a reference) to the main solution and registered it as an ...
l.raimondi's user avatar
0 votes
1 answer
724 views

Best practice to compare Object properties in C# Lottery Ticket

I am trying to build a lotto ticket validator in C#.. The progam will allow users to generate a ticket with a collection of multiple chances.. Each chance will consist of 6 numbers. 5 Regular numbers ...
digiShadoe's user avatar
1 vote
0 answers
41 views

Laravel is it correct to set up a Model to get data from SQL's views?

Imagine I have my DB structure with tables A, B, C ... N Tables have their relations. Nothing new... Could it be a good a idea to set up a model that implement a group of methods to retrieve views of ...
koalaok's user avatar
  • 5,374
0 votes
1 answer
125 views

Not able to access json data assigned to ViewData in MVC

I read the JSON file and assigned it to ViewData as follows var jsonReader = new StreamReader(Server.MapPath("~/App_Data/QandAFile.json")); var rawJson = jsonReader.ReadToEnd(); jsonReader.Close(); ...
Sabyasachi Mishra's user avatar
1 vote
0 answers
722 views

UseOpenIdConnectAuthentication with IdentityServer3

I have a project with local Identity users. At some point the IdentityServer3 was installed in this project and uses the same SQL database to authenticate remote users from different projects. Now I ...
Yuri G.'s user avatar
  • 47
0 votes
1 answer
96 views

Proper use of c# razor Checkbox with Model in WebApp

I have problems creating a well working Checkbox in my c# WebApp. Could someone show me a working version with a model and also how the View and the controller looks like. Model: using System; ...
Mr. P's user avatar
  • 103
0 votes
1 answer
139 views

Can't set value of variable without it returning nil

I've run into a strange issue with Swift - All I am trying to do is update a label from my model. This is a method in viewController.swift that is called from model.swift: func scoreDisplay(score:...
123's user avatar
  • 8,853
2 votes
1 answer
55 views

formatting an array in specific way to show in a view

I have two tables for Questions and Answers. The answer table has the primary key of the question table as a foreign key. I have retrived the data using a join query as follows. public function ...
CraZyDroiD's user avatar
  • 6,943
1 vote
1 answer
2k views

How to Apply changes to resource.resx file during runtime(for changing language)

How to Apply changes to resource.resx file during runtime my code is below, my problem is resource file is resorce.resx is changing but am getting it only after second reload string ...
Sreepathy Sp's user avatar
0 votes
2 answers
52 views

Data is always null when send from view to web api controller

When I send data from my view to web api controller my ID fields are always got null in controller, below is my code $scope.Create_Click = function (CategoryselectedItemvalue, ...
Muzammil's user avatar
  • 117
0 votes
1 answer
314 views

the breakpoint will not currently be hit. no symbols have been loaded for this document vs 2013 javascript

This is an MVC5 related issue. I cannot debug my javascript codes but I can debug my C# codes, it's so annoying, I read many solutions but none of them worked for me.
Eric's user avatar
  • 760
0 votes
1 answer
96 views

How to handle domain objects hierarchy

I'm working on a personal project manipulating list of bets and odds in sport games. So I've got a sport->event->match->bet->odd hierarchy to handle. I'm trying to do it, also as an exercise as I'm ...
Hector's user avatar
  • 101
0 votes
1 answer
675 views

'GeneralInformation': cannot reference a type through an expression; try 'WebQuoter.Models.Chiller.GeneralInformation' instead

I have the following model: namespace WebQuoter.Models { public class Chiller { public class GeneralInformation { public string AssemblyID { get; set; } ...
Drewber81's user avatar
0 votes
1 answer
1k views

How can Install CKFinder in ASP.NET MVC C#

I use CKEditor for my HTML Editor in project How can install CKFinder in my project for select picture from that ?
Mohammad Esmaeili's user avatar
0 votes
1 answer
24 views

How to use eventlistener on navigation EXCEPT on 2 things

I have two kendo menus where I want the page to be reloaded. However, per request from our client, they don't want the user to be able to click the back button. Here's the code I'm using for that: &...
tshoemake's user avatar
  • 1,341
0 votes
1 answer
75 views

Ajax.BeginForm displaying partial view correctly in Chrome/FF but on new page in IE

I've previously had a similar question answered which was resolved by downloading Ajax unobtrusive but a similar thing is now happening again after I've now published my website to IIS. Please see ...
thamoomin's user avatar
0 votes
0 answers
699 views

how to display an alert box after successful registration and at the same time clear text boxes after the alert box

here is the code for my Controller Below i tried to do the method for alert box but when i add the one for clearing text boxes my alert box message stop completeley to show. please anyone who knows ...
Yonela's user avatar
  • 81
1 vote
1 answer
56 views

Populating the view using data from db and has its values populate as radio buttons in codeigniter

I have 2 models in codeigniter as follows, Question class can have 1 or many answers. I have come up with the following models. class Answer{ private $id ; private $question; private $...
Lahiru Liyanapathirana's user avatar
1 vote
2 answers
37 views

I'm really confused with my form

The reason for confusion is in the beginning of the day all my forms were working. After I was styling the project, all my forms stopped working. When I submit all, the transaction works in the ...
Jake's user avatar
  • 482
3 votes
1 answer
363 views

render partial view from jquery not working

I have some issues with rendering a partial view using jquery. Even if it was asked more than once (here), I didn't found a solution that worked for me: My view: @model IEnumerable<OdeToFood....
Buda Gavril's user avatar
  • 21.5k
0 votes
1 answer
322 views

Not able to call the function within the index.php from the controller

So I'm learning PHP and have started with something very basic. I am trying to call a function from a file within my controller folder however it will not work. I have been successfully able to ...
Wendy O.'s user avatar
  • 191
3 votes
1 answer
4k views

Getting the Value from a Datatype Dropdown (Umbraco)

I am trying to get the name or shall i say the value of the dropdown pre value created using the umbraco datatype "dropdown" Now when specifying the "id" it gets the number, how do i get the value of ...
mjcoder's user avatar
  • 1,009
0 votes
3 answers
347 views

How to remove a single record from many to many relationship in symfony usiing doctrine?

here are the the two classes with the functions involved section class has many to many relation with student class class Section { /** * @ORM\ManyTOMany(targetEntity="Student",...
Hatem Said's user avatar
0 votes
1 answer
205 views

Graph Dracula MVC

I have a lot to do with nodes and edges. I need to pull from a file/store, draw the graph, and allow interaction to apply filters or rendering styles. Graph Dracula seems perfect. Unfortunately, I ...
David Brown's user avatar
0 votes
1 answer
196 views

I am getting "HTTP Status 404 - /MVC_demo/LoginController". Please check if there are any errors in my programs [duplicate]

I have made a login validation project using model, view, controller but its not showing the intended result.There might be some error in controller part i guess.please have a look and see if there ...
Gaurav Tolani's user avatar
2 votes
3 answers
5k views

How to disable button if no checkbox is selected

I got the following angular template: <tr ng-repeat="user in users"> <td><input type="checkbox"></td> <td>{{user.username}}</td> <td>{{user....
Michael Pittino's user avatar
1 vote
2 answers
283 views

I need a help in custom mvc login page and dashboard display user details and pic MVC4

I'm a student now I'm learning MVC4. I have designed a custom website in MVC and there is a custom user login form and Dashboard. I have created a login filed with an Email and Password and a ...
omstackoverflow's user avatar
0 votes
1 answer
263 views

AngularJS : ng-repeat not working

I'm currently developing a SPA application using angularjs and MVC Web Api. I'm trying to fill a grid by fetching data from SQL Server binding it to a datatable and then passing: { "countryID":...
Midhunraj Rajan Thadathil's user avatar
1 vote
3 answers
1k views

How to avoid bloated ViewController in MVC with Swift?

I am trying to keep to the Apple MVC design pattern where the view receives input and passes it on to the controller. To keep the controller thin and to avoid it turning into a bloated GodClass doing ...
hitlad's user avatar
  • 431
-1 votes
2 answers
1k views

Calculator using MVC

I am new to MVC and C# and I have to make a calculator with buttons for the number. How can I pass the values of the buttons from the view to the controller? Is there any source code that I can use? ...
Lana Abusabha's user avatar
0 votes
1 answer
240 views

what is the Action-Mapping XML file?

need to get a few things cleared up. I have been looking for an answer for this one, but I can't seem to find a good answer to my specific questions I read that " Controller Servlet works as a ...
It student's user avatar
1 vote
1 answer
1k views

ajax call in mvc using web api

I have written simple webapi method. I am trying to access that method in mvc using ajax call. I am getting output in browser and fiddler . But Its not working in cshtml page.Please let me know , If I ...
vishnu vardhan reddy's user avatar
13 votes
2 answers
12k views

Django distinguish between get / post in view's methods

I've been working with other languages where I could simply have one method name (in controller) for one action (lets say login). For example in spring MVC I can have one method named 'login' and set ...
Pink's user avatar
  • 441
-1 votes
1 answer
36 views

My view actionlink does not send a parameter

Hi i have this actionlink in my "cursos" index view(wich redirects to another controller) @Html.ActionLink("Ver Alumnos", "Index", "Usuarios", new { id= item.idCurso}, null) in my controller i got ...
Fela Bird's user avatar
0 votes
1 answer
63 views

Why is my action result giving me a 404?

I have this controller: public class ActivityController : Controller { // GET: Activity [HttpGet] public ActionResult ProfessionalActivityForm() { ...
default_noob_network's user avatar
0 votes
1 answer
27 views

Separation of concerns para custom component?

Using ExtJS to create a custom component that will be potentially shared between projects. Normally creating my views I would connect the events for each component / sub component to it's controller. ...
Martin's user avatar
  • 24.1k
0 votes
1 answer
232 views

What I am doing wrong? Trying to get response from the API

I am trying to get any response from my API. I have read a lot but any way get 404 (The resource cannot be found.) Here is my code Web.config: <authentication mode="Forms"> <forms ...
curiousity's user avatar
  • 4,733
1 vote
1 answer
1k views

Codeigniter Image uploading not working on live server

I have a situation where a user uploads his/her trip photos. They are saved in a folder and also supposed to be in database. Situation is: my code is working perfectly on localhost, and many other ...
Zafar's user avatar
  • 321
2 votes
1 answer
109 views

PHP - What is wrong? Learning MVC - Beginner

Hy, i started learning PHP and i created a simple MVC Style Codebase. The Script just generates a random number and displays this numer. I also write a function to display the number shown before but ...
Berndinox's user avatar
  • 2,104
0 votes
2 answers
1k views

refresh a partial view in mvc

i'm having a detail view in which there will be a conversation, and even comment box in conversation. I had a comment box in partial view. but had an issue when decided to refresh just the ...
coder771's user avatar
  • 368
1 vote
1 answer
298 views

Java MVC button not calling function

I'm still a beginner at Java and this is my first time trying to use the MVC-model. So far everything worked and I've done two small examples successfuly. However now I'm having an issue in my ...
APL's user avatar
  • 101
0 votes
1 answer
122 views

angularjs $http.post with parameters get null

I am using angular for login page but return null parameters to controller. view page:this my code in view page <div ng-controller="LoginController"> <form novalidate name="f1" ng-...
user avatar
-1 votes
2 answers
559 views

How can we use one div one multiple places in View in Mvc

How can we use one div on multiple places in View in MVC. Suppose I have declared one div and just call that div in multiple frames in Views razor in MVC.
Rishi Tiwari's user avatar

1
338 339
340
341 342
673