mvc

IEnumerable and string array - find matching values

Background: I have an ASP.NET MVC view page with a MultiSelectList in the View Model. I want to populate a label with the list of SelectedValues from that MultiSelectList object. The list is stored within the MultiSelectList with a type of IDName: public class IDName { public int ID {get; set;} public string Name {get; set;} } ...

Should I use a framework or write my own MVC?

I have a project that is currently all over the place and i'm thinking of making it MVC. The problem is that the system is currently being used and I can not change the interface (It's in frames :s) Also there are certain things that I will need to handle myself such as password generation, login and user levels. I already have the mod...

Advantages and Disadvantages of using MVC Design Pattern (Model View Controller)

I am at the point in my design where I am contemplating dropping the MVC design for performance reasons, not sure if straight out PHP pages with header/footer includes would out perform my MVC setup (using PHP/Zend). I have a feeling it would. Comments? ...

Is there any way to overload extension methods in C#?

I have the following Model pattern: public abstract class PARENTCLASS {...} public class CHILD_A_CLASS : PARENTCLASS{...} public static class EXTENSION{ public static METHOD(this PARENTCLASS parent){...} public static METHOD(this CHILD_A_CLASS child) {...} } Something like above, of course there will be more child (and grandchild)...

Handle Invalid URL in MVC

How to handle invalid URLs in MVC? For ex.: When the user enters http://localhost/User/MyProfile instead of http://localhost/User/Profile, it will throw an exception. How to handle this request? ...

When to add Model (of MVC) to Interface Builder?

In the Stanford iPhone course CS193P assignment 2 (free online course), the step through says to add the model into the NIB via Cocoa Touch Plugin -> Controllers -> Object. Is this for initialization purpose only? Why can't I just instantiate and initialize my model in the awakeFromNib method within the controller class itself? ...

Issues with my MVC repository pattern and StructureMap

I have a repository pattern i created on top of the ado.net entity framework. When i tried to implement StructureMap to decouple my objects, i kept getting StackOverflowException (infinite loop?). Here is what the pattern looks like: IEntityRepository where TEntity : class Defines basic CRUD members MyEntityRepository : IEntityReposito...

Execute action without redirect.

Hi everybody. I have a little question to community. Does ASP.NET MVC allow to execute an action of another controller without RedirectToAction() method and without creation of an instance of this controller? Thanks in advance, Ivan. ...

Bad request 400 for HttpUtility.UrlEncoded URL segments

So, if there are url encoded segments in my apps MVC url, IIS throws a BAD REQUEST 400. e.g. http://u.lasoo.com.au/Offer/*9289--750W-Generic-ATX12V-Power-Supply-%252449dot99/6355 <--- the '*' and '%' are causing this error. Notice that http://u.lasoo.com.au/Offer/The-Giant-Good-As-Gone-7-Day-Sale/6354 works fine. What's the correct ...

Where is MVC a bad thing?

I've been reading through a couple of questions on here and various articles on MVC and can see how it can even be applied to GUI event intensive applications like a paint app. Can anyone cite a situation where MVC might be a bad thing and its use ill-advised? EDIT: I'm specifically talking about GUI applications here! ...

Average Price - Appropriate logic to perform in the View or better in the Controller?

Would it be ok to put an "average price" calculation, as below, in the view? Or is this against MVC and is it better to do this in the controller? <p>Average price: <%= @seller.total_sales / @seller.num_sales %></p> ...

Which PHP framework would you suggest for this case?

I want to create an platform for a local old-timer club, which has: built in forum (not so over sized like phpbb & others. lightweight and highly integrated.) member profile with 20 fields members can create a garage members add car pictures to their garages others can vote and comment the pictures members can message each other and ...

Rails dashboard design: one controller action per div

I am implementing a dashboard as a relative Rails newbie (more of an infrastructure guy). The dashboard will consist of multiple pages, each page of which will contain multiple charts/tables/etc. For modularity, I want it to be as easy as possible to add new charts or change views of the data. Say one page has 5 different charts. I c...

Is this MVC? What 'design pattern' have I used?

There's a lot of confusion over MVC but after flicking through a Head First patterns book (As a side note I hate that brand, though this example was quite good) it claims that MVC or Model View Controller is a hybrid of multiple patterns - mediator, observer etc... In a recent prototype I did the following, it's C# but should be straigh...

Authorized View or Configure View as Authorized?

Is it best to create a separate view for authorized and unauthorized even if there will not be a lot of additional information in the authorized view? Or should there be one view and with model data adjusted accordingly? EDIT: In MVC, I believe it better to have 2 views and then use partial views for the duplicate information. agree? ...

universal php mvc?

anyone know of a good universal mvc written in php? i'm looking for an mvc that i can instantiate into any type of application that fits in what project i will be building and will contain a huge amount of libraries at hand being very easy to instantiate a library into the application when needed. thanks ...

Rails: Set a common instance variable across several controller actions

How should one have several different controller' actions set a common instance variable for use in templates but after the action runs. In other words, I want this to work in my application_controller. class ApplicationController < ActionController::Base after_filter :set_something_common def set_something_common # All contro...

Ok to instantiate an object in the View?

Is it ok to instantiate an object in a View before passing it to a partial? <%= render :partial => "trade_new", :locals => {:trade=>Trade.new("e", "b") } %> Or is better to instantiate any objects in the Controller as instance variables: @trade = Trade.new("e", "b") and then pass the instance variable to a partial in the view like ...

bind jquery DatePicker after partial update in ASP.Net MVC

In my view I`m using an Ajax call to dynamically show a form to add a new entry to a list. After the entry has been added sucessfully the list will be shown again. However, in this form I have a textfield where the user needs to type in a date. What would I need to do to dynamically bind the jquery UI DatePicker to this field? ...

problem displaying unicode using Spring MVC

hey guys, I am trying to display some nepali langauage charcaters in my spring MVC webapp with freemarker, i did everything like i have character encoding filter in my web.xml <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> ...