model-view-controller

Add OnClick Event to Html.RadioButton

旧巷老猫 提交于 2020-02-05 04:22:50
问题 What I want to do is to call a JavaScript routine when the user clicks on a radiobutton. I've some fields to enable/disable when this happens. However, when I enter <%=Html.RadioButton("obp17", "57", ViewData.Eval("obpValue17").ToString().Equals("57"), new {@onclick = "Yes()"})%> I'm getting a "type or with" expected error when trying to add the onlick event. This should be easy, but none of samples I've found seem to work. The leading "@" is common in all the examples I've found, but

How can I write a unit test for a controller class that uses winforms for views?

白昼怎懂夜的黑 提交于 2020-02-03 07:18:10
问题 Has anyone been able to successfully unit test methods that are, by necessity, coupled to the System.Windows.Forms.Form class? I've recently been working on a C# winforms application, trying to build it with an MVC structure. This is difficult enough, given that the framework isn't really built with this in mind. However, it gets even tougher when you throw unit testing into the mix. I've been making sure that my controllers are not coupled to concrete view classes, so that I can use a stub

MVC Model child object null on HTTP post

梦想的初衷 提交于 2020-02-03 05:39:12
问题 Hope someone can help me. I am new to MVC, coming from a winforms/console/vb6background. Apologies if this has already been answered, I am stuggling to understand how I can resolve the below issue. I have a view model : public class testvm { public int id { get; set; } public DateTime date { get; set; } public student studentID { get; set; } public testvm() { } public testvm (student s) { studentID = s; } } I am pre-populating the student child object of this ViewModel before it is passed to

Send daily notification mail from asp.net mvc web app [closed]

折月煮酒 提交于 2020-02-03 02:28:48
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last month . I've developed a C# web app MVC that gets some information from another site (Trello) through API calls, and allows the user to do some actions like printing an .xls file with all card details. Now, I want to implement a functionality that sends every day at a specific time in

Unable to redirect from one controller to another controller-Spring MVC

你离开我真会死。 提交于 2020-02-02 14:41:44
问题 I am new to spring MVC and facing some error. I have two controllers as below 1) LoginController.java @Controller @RequestMapping("/log") public class LoginController { @Autowired private LoginService service; @RequestMapping(value="login.spring",method=RequestMethod.GET) public ModelAndView prepareLoginForm() { System.out.println("In get"); return new ModelAndView("Login", "login", new Login()); } @RequestMapping(value="login.spring",method=RequestMethod.POST) public ModelAndView

What is the best way to migrate an existing messy webapp to elegant MVC? [closed]

房东的猫 提交于 2020-02-02 03:32:05
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I joined a new company about a month ago. The company is rather small in size and has pretty strong "start-up" feel to it. I'm working as a Java developer on a team of 3 others. The company primarily sells a service to for businesses/business-type people to use in communicating

How to use sessions in a .net core 2.0 class library project

北城以北 提交于 2020-01-30 10:52:04
问题 We have a .net framework (4.5.1) asp.net website which authenticates users and and stores authentication details in a .net framework class library. This class library when referenced in a the target asp.net .net framework (4.5.x) website can access all the variables which were passed by the originating web site. We want to change the target applications to be in .net core 2.0 mvc. What I am trying to do is write a .net core (2.0) class library which will be referenced in the target app and

UnauthorizedAccessException when saving file, but can create a directory

吃可爱长大的小学妹 提交于 2020-01-30 09:23:10
问题 I'm trying to save a file to the disk but I get UnauthorizedAccessException. The error says I have to get the right permissions on the folder, and I've tried every possible user I can find but it doesn't work. Tried the following users Network Network Services IUSR IUSR_[Computername] And given the full rights without it working. What I find really strange is that I create a directory before I try to save the file and that works perfectly, it's when trying to save a file to that new directory

How to load a heavy model when using MVC design pattern

心已入冬 提交于 2020-01-30 03:45:15
问题 I'm building an application with wxPython and a Deep Learning model that I created using Tensorflow. The design pattern that I'm using is MVC. My problem is that the deep learning model is very heavy and it takes a very long time to load (like ~2 minutes) and in the meantime the GUI hangs. I created a sample code that describes the process. Here is what the GUI looks like while loading: enter image description here and this is what the GUI looks like after the loading: enter image description

Loading Partial Page With Angular and Compile The Controller

依然范特西╮ 提交于 2020-01-29 02:34:05
问题 In large scale application, our web application might be organize into separate partial page in order to increase the modularity of our application. In some case compiling a partial page loaded through XHR or Ajax request either using Angular $http.get or JQuery $.load will introduce an error. Using my scenario as example, exactly I'm using Kohana PHP framework so i can control the modularity of my web application on the server level. As usual all template and page been separate into view,