I have a few objects that are incredibly similar. In fact, they use STI and store all of the data in the same table in the DB. Currently, every time I add a feature or fix a bug, I have to update it in 3 different places, so I would like to DRY my code a little bit. The most common code duplication is in the views. I have seen people usi...
WOW
remind me never again to use 50+lines of java-like constructs when this can be done so easily in C# with implicit casting
...
Hi guys,
Im trying to bind a dropdownlist in ASP.NET MVC to a class. Luckily for me this will be a number between 1 and 10, however I'm not getting the output in my HTML that I would expect. I've set both the value and text properties which are populated ok in the View, but the selected value refuses to render. This is within the initia...
I've got a viewpage with the inherits part looking like
Inherits="System.Web.Mvc.ViewPage<User>"
and a ViewUserControl with the inherits part looking like
Inherits="System.Web.Mvc.ViewUserControl<Address>
where User class (shortened) essentially looks like:
class User {
public virtual Address address { get; set; }
}
Now, if I t...
The main page (asp.net/mvc) only seems to have a getting started guide and tutorial, plus videos, but I'm not able to find a proper documentation (classes, methods etc). Any link that can help me?
Thanks
...
So I have been waxing lyrical about a ASP.NET MVC to a friend who is about to start development of a new user interface....
He asked me if you could solve the following problem with ASP.NET MVC:
Imagine a web app that supports plugins. In the current ASP.NET WebForms app the pluggin developer provides a usercontrol and some JQuery.
The...
I've got the following set up in the web.config of my ASP.NET MVC application:
<authentication mode="Windows" />
<authorization>
<allow roles="MySecurityGroup"/>
<deny users="*"/>
</authorization>
<customErrors mode="On" defaultRedirect="Error.aspx">
<error statusCode="401" redirect="Help.aspx"/>
</customErrors>
Everything...
So im using presentModalViewController and dismissModalViewController with animation set to "YES" in both cases. Which works fine.
However, after the modal view is dismissed, all of the content on the main view has moved down what looks like 20px.
Would anyone have ANY idea on what could be going on with that?
...
Have a problem following the MVP or MVC design pattern (applies to either one). I can't figure out how to cleanly prompt for user input from the model layer? Depending upon certain values in the model, I may need to prompt the user for input during the middle of a process.
For example, we'll take a hypothetical PO entry process. Say ...
I understand more or less how does MPV works.
But I don't get what classes:
QAbstractItemModel
QAbstractItemView
QAbstractItemDelegate / QItemDelegate
Can do for me?
If that is relevant, I'm using
QGraphicsScene / QGraphicsView with some elements (visual representation of game board) that user can interact with while the interaction log...
Say i have the following:
public class Person{
public int ID {get; set;}
public string Name {get; set;}
}
public class Phone{
public int ID {get; set;}
public string PhoneNumber {get; set;}
}
public Class AddEditViewModel{
public Person MyPerson{get; set;}
public List MyPhones{get; set;}
}
I want to create a...
Hi everyone,
recently I was needed to enhance Magento (1.3.1) user interface. Particularly add a product image switcher (following http://inchoo.net/ecommerce/magento/create-a-color-switcher-in-magento/).
The results:
- image switcher works as expected, which is fine.
The problem:
- The product itself could hold as much as 15 or 20 col...
I have a controller action that aggregates data from multiple sources: web service, database, file lookups, etc... and passes results to the view. So in order to render the page all tasks must have completed. Currently they are performed sequentially but as they are independent I am thinking of running them in parallel as this could impr...
When I'm adding a new strongly-typed view to an ASP.NET MVC project, I can select between different view content templates (Create Details, Edit, List). I have read these are templates based on the Visual Studio T4 code generation engine.
How can I author and configure my own templates and let them appear in the available templates when...
Hi,
I tried to follow this but the default modelbinder let my array null on the server side.
HTML:
Question 1:
<input name="list[0]" type="radio" value="1000" />No
<input name="list[0]" type="radio" value="1001" />Yes
Question 2:
<input name="list[1]" type="radio" value="1002" />No
...
Controller action:
public ActionResult Anamne...
I'm unsure if this has been asked before but here goes.
I have an MVC application with the HTML looking like this;
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<EnvironmentalVandals.Controllers.MonthlyItemsFormViewModel>" %>
I have in the controller the following;
[...
I was running through the Movie Database MVC example on ASP.net. For some reason, when I right click the controller folder in Visual Studio solution explorer, I don't get the controller option from the add menu. I have Visual Studio 2008 SP1 and using .net 3.5.
Any ideas why the controller option is missing?
...
HI I have a table with some some values (IDs), and of course when i get the result i got just the int IDs, but i want to put it more user friendly, for example when its the number 1, i want to put the string "Avaible", when its 2 "Not avaible", im on an N tiers enviroment and i need to get this done on the Model, whats the best way to a...
I am using a MVC framework which is a bit like struts.
So, say I have a "Edit Store" link in my application this is how the url would look like:
http://localhost:9080/test?action=editStore&storeNum=10
Now, action determines my Action (analogous to Struts Action) to be run. The corresponding action here is: EditStoreAction. Clicking...
I'm getting the error message above when adding an onchange attribute to a Html.DropDownList in ASP.NET MVC:
<td><%= Html.DropDownList("taskTypes", (IEnumerable<SelectListItem>)ViewData["TaskTypes"], "None", new { onchange = "document.getElementById('NewTask').submit()" })%></td>
When the view initially loads, I do not get the error. ...