mvc

Ruby on Rails: Access information from other models?

Another newbie Ruby on Rails question: In my post view, I want to show the authors name. The post database table stores the authors id which is the same as the users id column in the users table. The user also has a username column in the user table. So having the users id, how do I get the users name? ...

MS Test newbie question

I'm working on an MVC site with an image upload capability, and I want to write a test that will upload an image. Sounds simple. I made an image called TestImage.jpg and set Copy to Output to be "Copy if Newer". In my test I try to load that with the following code: System.Drawing.Image testImage = System.Drawing.Image.FromFile(@"Tes...

Do you know of any ASP.NET MVC code generators?

Does anyone know of a good/usable ASP.NET MVC code/solution generator. Ideally it would build from a domain model, but from a data model is also acceptable. If you do, can you answer the following: Does it produce "good" code? Can it be extended? What do you like and not like about it if you have used it? What great fearures does it c...

MVC large websites, use one controller...or many?

I have a pretty large site, and I am looking for the most time efficient way to manage it (I am the sole coder). I am trying to devise a very simple MVC structure (i don't want to use a framework) to help keep all my code in order. For a huge site, is it better to have only one controller to handle all the pages, or is it better and ea...

How to reuse methods in ZF views

In my application i have the following classic template on 3 columns ********************************************************* * * * * ********************************************************* * * * * * * * *...

Accessing a web.config file in a third party library

Hi, I'm writing an IHttpFilter which needs to be in a seperate project (these are all C# projects) to be used in a set of ASP.NET MVC Applications. In the IHttpFilter I have to determine a few things that are specified in the web.config file. Is there a way of retrieving the current web.config file from an external assembly at runtime?...

New MVC architecture paradigm for web apps?

After reading a couple articles about web MVC architecture, I'm conflicted about how to go about creating an modern web application nowadays. The previous web paradigm consisted of: Model: Business logic server View: Dummy browser client that showed whatever the controller told it to show. Controller: Web server tier that maintained...

Web app entity 3 step creation with MVC(either asp.net or rails)

Let's say I have an Employee, and for the creation of such employee in my web application I want to follow the next flow. Create <-> Verify -> Save In the create page the user can set up a bunch of properties, In the verify page the user is presented with two options "make changes" and "verify" In the save page the user is presented w...

AJAX JSON calls in MVC to filter List in my View

How would I use Ajax do a filtering on a list view in MVC. Scenario: List all the news items. To the left is a filter list of categories. Check which categories to show and click the filter button ( or as you check and uncheck it performs the filter ?) to filter the list of new stories. Here's my View code for iterating the items in ...

ASP.NET MVC + move login controls to home page

This has really been bugging me. I would like to have the login interface on my home page for ASP.NET MVC. I have tried creating a partial view inside of the ~/Views/Account/ directory named LogOn.ascx but when i try to submit the values via the submit button, everything blows up. Am I missing something or is there an easier way to do th...

create dynamic controls with ASP.NET MVC

Hello Everyone, In my current application we create controls dynamically inside panel based on database value. Like, Type controls, Style, width, etc. Is it possible to do something like this using ASP.NET MVC? Thanks, Alps ...

ASP.NET MVC - How to get checkbox values on post

Hey all, this is a newbie ASP.NET MVC question. I have a view that has a list of checkboxes and a submit button. On submit it posts to a controller method but I can't figure out how to get the values of the checkboxes. Also, I can't figure out how to get model data that I passed into the view when I'm in the post method, I tried using ...

Is there any book which teaches MVC in PHP?

I am not looking for PHP frame work books, they just make me confuse. I like to learn how to design my own MVC framework for PHP. ...

ASP.NET MVC View friendly name for foreign key

On my index/list view I have a list of records from the database, currently they display the foreign key id, I would like to change this so that it displays the text name column of the reference table. I can't seem to find any examples on this, am I missing something really simple? ...

Does the business logic falls into Model in MVC?

Hello all, Quiet a few times i have read this issue and still i was not able to find it exactly. Does the business logic falls into Model or in the controller in MVC Pattern? Thanks ...

C#/WinForms: Do I need the IWin32Windows?

When writing WinForms application with proper separation between View- and Controller/Presenter-functionality, I often find myself writing code like this: public void class SomeView:Form{ private void loadFileButton_Click(object sender, EventArgs e) { _loadFileAction.Execute(this); } } public void class LoadFileAction:Action{...

MVC url Rewritting somthing like http://controller.website.com

Hello, Using MVC. Is there a way to make any url like .Mysite.com to point to mysite.com/user/ as in http://marwan.mysite.com to point to mysite.com/user/marwan The controller is user and the action is index which takes marwan as its variable. One idea i had is to make a custom error page to handel 404 and see if the url starts with ...

.NET MVC instantiate controller inside another controller

Is it possible for an ASP.NET MVC controller to create a new instance of a different controller and effectively delegate resonsibility to that? Let's say for example that I have two controllers in the /Controllers/ directory: public class HomeController : Controller { public ActionResult Index() { var otherControlle...

Separating SQL, PHP and the view when listing categories and products in Kohana

I want to migrate to Kohana with my small websites and I'm trying to separate the SQL, PHP and the view, but I've some problems with this one. I have to tables. Every category can have multiple products. Categories table id category Products table id category_id product This was my previous code (converted to Kohana's query bui...

Persist querystring parameter on paging with Stephen's walther tip #44?

Hello all, I'm using Stephen Walther's paging tip #44 (http://stephenwalther.com/blog/archive/2008/09/18/asp-net-mvc-tip-44-create-a-pager-html-helper.aspx) on my app and it's working just fine, however on pages where there are querystring values, the values got omitted/stripped out. For example, on the search page: mysiteURL/Search?sea...