Hello.
I've had mostly experience with "server-side" mvc frameworks very popular in different languages like ASP.NET MVC or Zend Framework for php, Spring for Java etc.
Some of them are also possible to use for desktop applications development but I never tried that.
I fully understand that design patterns should not limit implementati...
i would like to write a message using an instince variable in the new invition action like this. redirect_to new_invitation_path("invite your friend")
Controller invitations:
def new(message)
@message = message
@from_user_id = facebook_session.user.to_s
end
Apparently it is not possible how can i find a way around this?
...
How would I go about implementing a signup form using the MVC pattern for a website (I'm using PHP)?
I think the controller should receive the POST data initially. Then probably some interation with the model might need to take place (if the user successfully signs up). Then I think the signup form view would be called, and a value woul...
What is difference of developing a website in MVC and 3-Tier or N-tier architecture?
Which one is better? What are pros and cons?
...
Hello everybody,
I have
[DisplayName("Country")]
public List<SelectListItem> Countries { get; set; }
property in strong-type Model View class for DropDownList.
When I try to check if the ModelState.IsValid on form postback it's always false & error for Countries tells "Can't convert [value] to SelectListItem" or some of a kind.
I...
I'm about to do a PHP website using the MVC pattern. I am not using a framework as the site is fairly simple and I feel that this will give me a good opportunity to learn about the pattern directly. I have a couple questions.
Question 1: How should I organize my views? I'm thinking of having a Page view which will have the header and fo...
I am working on a form which displays information about orders. Each order has a unique id, but they are not necessarily sequential on the form. Also, the number of fields can vary (one field per row on the form). The input into the form will not be mapped straight into the database, but will be added to the current value in the datab...
I tried to use Controller.TryUpdateModel() of ASP.NET MVC. What does it do in detail. In my example it fails (i.e. returns false). So how can I find out, what is the reason for the failure?
...
[MetadataType(typeof(OrganizationGroupFormViewModel))]
public partial class OrganizationGroup { } same name as generated in linq to sql?
public class OrganizationGroupMeta
{
// datannotation validations comes here ?
}
public ActionResult Create()
{
OrganizationGroup OrgGroup = new OrganizationGroup
...
Lets say I have a StartDate and an EndDate and I wnt to check if the EndDate is not more then 3 months apart from the Start Date
public class DateCompare : ValidationAttribute
{
public String StartDate { get; set; }
public String EndDate { get; set; }
//Constructor to take in the property names that are supposed to be che...
Hello.
Instead of using Html.ActionLink to load subpages into MainContent, I would like to load them with ajax.
For example (taken from Site.Master):
<%= Ajax.ActionLink("HOME", "Index", "Home", new AjaxOptions() { UpdateTargetId = "main" })%>
<%= Ajax.ActionLink("ABOUT ME", "In...
IIS 7.0 (Shared Hosting)
ASP.NET 2.0 Integrated Pipeline mode
MVC 1.0
I get a 404 on every url except /default.aspx.
I have this in my web.config:
<system.webServer>
<defaultDocument enabled="true">
<files>
<clear />
<add value="Default.aspx" />
</files>
</defaultDocument>
<directoryBrowse enabled="false" />
<val...
I have a mvc app that currently is branded to one brand.
I want to add a user control that will hold a list of brands and when the user makes a selection the Master Page is swapped out, the styles will also be changed as the stlye link is held on the Master Page.
Has anyone done this before, is it possible and if so can anyone please s...
I have an MVC application with a simple control to all selection of All Dates or selecting a Date Range.
The radio buttons have an onclick handler to enable/disable the dat pickers. All work well so far.
When I try to set the correct context state for the datepickers after doing a POST I cannot get the jQuery selector to return the rad...
Hello.
There are several examples of using MEF to plugin whole controller/view packages into a MVC application, but i didn't found one, using MEF to plugin funcional parts, used by other controllers.
For example, think of a NewsService with a simple interface like
interface INewsService
{
List<NewsItem> GetAllNews();
}
That gets ...
Hi, I have a page for creation of dynamic entities.
<%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
...
I have two actions:
public ActionResult Create()
{
dynamic model = ...
return View(model);
}
[HttpPost]
public ActionResult Create(dynamic(1) entity)
{
...
}
Well, th...
First, some code:
Here is the initial Action that is called when the page is navigated to:
public ActionResult ListCodeTypes()
{
var CodeList = _entities.Master_Codes.ToList();
List<SelectListItem> items = new List<SelectListItem>();
for (int i = 0; i < CodeList.Count; i++)
{
items.Add(new SelectListItem {
...
It's been around 5 months since I picked up a PHP book and started coding in PHP. At first, I created all my sites without any organizational plan or MVC. I soon found out that was a pain..
Then I started to read on stackoverflow on how to separate php and html and that's what I have been doing ever since.
Ex:
profile.php <--this file ...
I'm confused somewhat by the MVC implementation as used in Objective C programming.
What is described as 'Controller' in Objective C tutorials and documentation, I understand as simply a view or mediator.
Which is correct?
...
I'm having an annoying issue with the RadioButton helper and Data Annotation used for validation:
I'm actually replacing a dropdown list with radio buttons (because the list is small). I'm not using MVC 2 or MVC Futures (though, I think I'd run into the same problem if I were using the RadioButtonList).
That particular field is require...