mvc

How do you localize/internationalize an MVC Controller when using a SQL based localization provider?

Hopefully this isn't too silly of a question. In MVC there appears to be plenty of localization support in the views. Once I get to the controller, however, it becomes murky. Using meta:resourcekey="blah" is out, same with <%$ Resources:PageTitle.Text%>. ASP.NET MVC - Localization Helpers -- suggested extensions for the Html hel...

Where to place the login/authentication related actions in MVC

I've searched around and found that when implementing an authentication module in MVC architecture some people opt to place the login related actions in the User controller while others place it in a controller dedicated to authentication only. In pseudo-java-like code: class UserController extends Controller { public login() { ...

Bind Java program to Cocoa interface

Hi, would it be possible to bind a Java application to a Cocoa graphical interface? I'm working in Eclipse right now, on my mac, and am wondering if Interface Builder could be used to construct a new interface so that I don't have to look at Swing all day. Any ideas/suggestions? Thanks! ...

Is it possible to pass route value to show the name of the user without the controller name in MVC

Hi all, I want to get the url for my site as "www.ABCD.com/username" without the controller name in MVC architecture, such that when i click the name of the particular user i want to show details of the user with just the name of the user showing in url. ...

MVC with cocoa/objective-c

Hi all, I have a strong j2ee background, and I am trying to move to objective-c for some desktop/iphone programming. I used many java web frameworks with mvc in mind, spring and struts ecc... so I am used to have servlet or controller which pass attributes to jsp pages, which is the view. In jsp pages with jstl you can call this attrib...

How to create dynamic views in asp.net mvc?

How to create dynamic views in asp.net mvc 2.0? ...

MVC delete parent after all children have been linked to other parents

Hi, I have this scenario to implement: a collection of parentEntities, each parentEntity having zero to childEntities. I need to implement a multiple-delete form (checked parentEntities will be deleted), with this rule: if a parentEntity has children, it can be deleted only after all its children have been linked to other parentEntitie...

How to make a list of json objects?

Hi, I'm using asp.net mvc2 and trying to send a list of json objects with hard coded values from the home controller, and receive them in index.... in the code below i'm sending 1 json object .... how do i send many? in home controller: public ActionResult JsonValue() { var result = new { ...

Approach to mapping dictionary database tables to models in MVC

Hi, lacking a fellow programmer to talk over the right approach for my problem, I decided to ask you. What is your preferred approach of mapping dictionary tables to a model in MVC paradigm, regardless of the MVC framework / environment you are using? My problem is I have a couple of database tables that only serve as dictionaries and ...

How to connect Model through Controller to View using bindings?

I have an NSTextField in my view. Its value is bound to an NSNumber *number in my controller. The controller simply calls through to the model (value) to get the appropriate value. // In the controller - (NSNumber *)number { return [NSNumber numberWithFloat:[model value]]; } - (void)setNumber:(NSNumber *)aNumber { [model setValu...

Can i change the view without changing the controller?

Pretend1 there is a place to type in a name:     Name: __________________ When the text box changes, the value is absorbed into the controller, who stores it in data model. Business rules require that a name be entered: if there is no text entered the TextBox should be colored something in the view to indicate baddness; otherwise it ca...

ASP.NET MVC jQuery ajax call returns status code -504 instead of 5xx on Safari 4

My MVC controllers return 5xx status codes to indicate errors when called using jQuery ajax. This works great on IE8 and Firefox. However, on my copy of Safari 4.0.5 running on Vista, this breaks. It looks like Safari is translating my 5xx status codes to -504. Successful ajax calls work fine, and I've already tried uninstalling and r...

How can the view show data that isn't in the model?

i'm facing the problem of the view showing data that's not in the model, and the model containing data that isn't in the view. Imagine the data model has a birth date field: DateTime: BirthDate; And the view lets the user enter a birth date:     Birth Date: 11/28/1973     And that date goes into the model via the controller and all...

In which controller do you put the CRUD for the child part of a relationship?

I am using ASP.Net MVC but this probably applies to all MVC patterns in general. My problem, for example I have companies and in each company I have a list of contacts. When I have selected a company I can see its details and a list of the contacts for that company. When I want to add a new contact for that company, should the implementa...

How to have the controller change its behavior depending on the view?

If from one view a user enters some invalid data, e.g.:     E-mail: [email protected]     then i want the controller to: not place the data into the model color the text box reddish not allow the user to save But it's possible that if the user enters the same invalid data in a different view i want the controller to: place the data ...

changing img src with JQuery but leave pathing info intact?

I'm using JQuery to switch out an image src thusly: $("#myImg").attr("src", "../../new.gif"); notice the relative pathing on the new src. Unfortunately, this isn't portable when I deploy my app. In my MVC app I'm using a ResolveUrl() method that will fix the pathing problem for me so it's portable, but now my JQuery image src swapper ...

asp.net mvc maproute

Greetings, I have a problem with link in mvc application. When I run it via Visual Studio it's ok. The link then is as follows: http://localhost:2566/ActivateClient/Activate/6543e2d6-707d-44ae-94eb-a75d27ea0d07 when I run it via IIS7 the link is as follows: http://localhost/ActivationService/ActivateClient/Activate/6543e2d6-707d-44ae-9...

How to show validation messages in MVC?

When a user tries to click:        Save and they have entered in some invalid data, i want to notify them. This can be with methods such as: directing their attention to the thing that needs their attention with a balloon hint automatically dropping down a combo-box triggering an animation showing a modal dialog box etc What is the...

What is the MVC equivalent of this code:

Here's the easy pseudo-code: void TextBox1Changed() { //If the text isn't a number, color it red if (!IsValidNumber(TextBox1.Text) TextBox1.Color = Pink; else TextBox1.Color = WindowColor; } What's the MVC enterprisey version? ...

dynamic action names in codeigniter or any php mvc framework

I've noticed many sites are able to use a username or page title as an action. How is this done? For example instead of www.example.com/users/my_username (where the users action is generic and responsible for fetching user data) how could I make this www.example.com/my_username? Thanks very much. ...