mvc

Using Code-Behind with ASP.NET MVC Views

Is it considered a bad practice to use code-behind with ASP.NET MVC Views? Got into a bit of a debate about this with my colleagues today and I was wondering the community's thoughts. Obviously, this isn't an option when using another MVC like Rails, which makes me think it's relied on more as a crutch for those accustom to working wit...

ActionLink behaving odd in ASP.Net MVC 2 Preview 2

This action link: <%=Html.ActionLink("About","About", "Home" ,new { @class="menulink" }) %> Produces the following href 'About?Length=4' so it works in the 'root' of the application, but does not once you go one level or more deeper. Also...why is the '?Length=4' being appended? Lol. ...

Switching Views in Actionscript 3.0 using MVC

Hello, I am working on a Flash/AS3.0 app that I want to use MVC on. The question I have is who is responisble for adding/removing views from the stage? Most examples I find have the doc class add the view, but I haven't seen an example for who notifies the doc class to remove the view. The structure of the app is one screen that sho...

Create a New big Object Wizard: ASp.net MVC

Hello everyone! Here's my question: I need to write a wizard, for customers to "create a new" very big objetc, with some other asociated with it: for example, Some images stored in another table (with relationships), some Lat's and Lang's for google earth, etc. Each of them are stored in diferent tables in the Database, and that's why, i...

KnownTypeAttribute error on ASP.NET MVC REST Object Array

I am using the ASP.NET MVC REST kit and all works great but when I try to return an array of objects I get the below error. Following the movie sample in the kit I couldn't find any references to them using KnownTypeAttribute. I have tried returning the object array via a list, array and as serializeable. Examples return View(ats.GetAs...

ASP.NET MVC Updating a list of objects on one form? (model binding to a list)

Hello (again) Quick question regarding updating a list of items in asp.net mvc. Basically I have an edit action method that returns a collection of objects (incidentally, the table structure of which looks as follows 'testID, assetID, Result' - a link table). I basically want this items to be displayed one after another in a form and ...

Disable link is user is not allowed to access target

Hi, I have created an ASP.NET MVC application and created different kind of roles for my users. I have then created different kinds of AuthorizeAttributes for allowing/disallowing access to different Actions in my controls. However I have got a lot of links that points to different of theese actions that are restricted for different ro...

asp.net mvc 2 DataAnnotations validation

I have just tried new version of framework (asp.net mvc 2 preview 2) that includes server and client validation with jQuery integrated, looks fine. it has attributes for properties in my model (entity) like DataType. where i expand to see which options i have so it has all what u want u dont, like Duration and PhoneNumber :) but i dont...

How to step out from https to http mode in asp.net mvc.

I have made my Login page as Https enabled by adding the attribute [RequireSSL] on controller Action and it works fine. But after successful login it remains in https environment, however the page is non https page. Can anybody give me workaround how to step out from https to http mode? Any help in this regard will be greatly appreciat...

ViewData in ActionFilterAttribute - Object reference not set to an instance of an object.

Hello all, I've been trying to load masterpage content from database (based on a "TargetCode" in the querystring), using ActionFilterAttribute. However, I'm having problem setting the ViewData to the data returned from the database, here is the code: public override void OnActionExecuting(ActionExecutingContext filterContext) { Ho...

'New' and 'Create' RESTful action names or 'Create' for both in ASP.MVC

The rails convention is to use New and Create for RESTful action names. The .NET MVC convention appears to be to use Create for both (usually with a post restrictor on the action intended to the true 'Create' method). Personally I would prefer to use New and Create in .net but have been using Create for both given the convention. What (...

Access to current_user from within a model in Ruby on Rails

I need to implement fine-grained access control in a Ruby on Rails app. The permissions for individual users are saved in a database table and I thought that it would be best to let the respective resource (i.e. the instance of a model) decide whether a certain user is allowed to read from or write to it. Making this decision in the cont...

Using LLBL as Model in MVC

I have settled on trying to use ASP.NET MVC but the first part I want to replace is the Model. I am using LLBL Pro for the model. I have a table called "Groups" that is a simple look up table. I want to take thhe results of the table and populate a list in MVC. Something that should be very simple... or so I thought.... I've tried...

iPhone How to dismiss a UITabBarController and then show it again?

Hello, I will try to explain myself as best as possible, I know the title does not say much. Basically i have 4 Navigation Controllers embedded in Tab Bar Controller. What I want to do is have one of this Navigation Controllers push a new Navigation Controller embeded in aTab Bar Controller dismissing the original Tab Bar Controller. ...

UIViewController subclass init not called when loading from nib

I tried overriding the default initWithNibName designated initializer of a UIViewController subclass like so: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } I have also included it...

Model View Controller inside a Model View Controller

I've just recently completed a personal project and one technique I did use to break down the interface was to have one main Model View Controller that was handling a lot of the main logic of the application. Then for the most part, there were many generic controls lets say a Slider and a Text Field that were bound together to a single f...

How to use Ajax for showing list from database in MVC

Hi On view users page am showing list of users in the list, and i want to show recent users by selecting dropdown of (Recent Users) in the same page. now am using post action to get the values and bind the list its getting full page load but i want to use to Ajax with Jquery option to show the list of datas in the same view page any one...

Mapping Castle MonoRail default requests to a controller action

Hi, I'm running a MonoRail application that has no routing configured. So I'm using MRs standard Area/Controller/Action.aspx scheme. (I changed the MonoRail handler to listen for .aspx requests). Now, the problem here is that /Home/Index.aspx is my start-page, yet if someone comes to http://server.com/ it's not transferred to /Home/Ind...

MVC routing doesn't pickup querystring

Hello all, in my Global.ascx.cs, I have this setting for the routing: routes.MapRoute( "HomeTarget", "{TargetCode}", new { controller = "Home", action = "Index", TargetCode = "" }); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // U...

Proper way of dealing with views in PHP

In the past, I've been creating my apps with basically a view (i.e. search.php or display.php) and a large file with a bunch of functions (i.e. library.php). I intend to change all this by going the MVC route w/o a framework. I just don't have time to learn a new framework, I want to get this done and do my best to separate the php code ...