mvc

Using Special Symbols in ASP.NET MVC Routes

Hello! I want to use the url such as "/ControllerName/ActionName/Id" Id - only digits or null. But when I use regular expression in MapRoute, "\d{1,4}", I see the exception - error404 page, when I'm trying to see /ControllerName/ActionName/" page. Also, I don't know, how I can catch exception with special symbol - ". Please, help.Thanx....

Codeigniter: when to use a model vs library?

I've starting using Codeigniter for a project recently (few months ago) but its getting a little out of hand with a bunch of models that need to interact with each other and I was wondering if I should be creating a library instead? In my case, I have a user action that happens when you win a game and it would get logged in my user_mod...

Shared View Controller access to model class

Hi, I am trying to keep close to the MVC approach to programming in an objective C application. I have a model class and two View Controllers. @interface Disc : NSObject { NSString *discType; NSNumber *capacity; } @property (nonatomic,retain) NSString *discType; @property (nonatomic,retain) NSNumber*capacity; @implementation Dis...

Create User and Edit User - DRY or separation, which is more important

I'm wondering what more experienced developers think about how to handle almost identical processes, such as a user creating a profile and a user editing their profile. At the moment I have a single controller method and single view which handle the distinction between a new user and existing/editing user, just by passing around an $edit...

asp.net mvc datannotation password validate

how can i validate a password with asp.net mvc dataanotation, the password must be between 6 and 16 characters ...

asp.net mvc datannotion regular expression

how can i create a regular expression for abcABC123/abcABC123 in dataannotion ...

In MVC Edit Action {HTTP POST} Using UpdateModel vs Request.Form Collection

I am working through sample MVC Nerdinner tutorial and using it on the AdventureWorks database. I have created an Edit action in the CategoryController to edit Product Category in AdventureWorks. The only updateable field in this table is the Name (the other fields - ID, RowGUID and UpdateDate are autogenerated). So my edit form View has...

JavaScript url auto-resolution in Asp.Net MVC

I am running Asp.Net MVC 2.0, and I am running into a problem with my JS calls. this is what I have in my : <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../../Scripts/jquery.js"></script> Which all works fine if I am on the root level. But if I jump up to something like:...

update view when preference changed in PreferenceActivity.onResume (Android)

I'm trying to keep a boolean preference in sync with a value in a content provider, and succeeding nicely except for this issue. When I set the preference in my PreferenceActivity's onResume() method (because the value may have been changed in the content provider), the checkbox in the view still reflects the pre-onResume value. As far...

How Testing relates to ASP.NET MVC/WEBFORMS Silverlight MVVM.

Ive been learning MVC2 and MVVM lately and I think it works like this. ASP.NET MVC2 - Can test the whole web site using unit tests ASP.NET MVC2 + jquery web service calls - Can no longer just use MSTest unit test. What is the MS product to test the javascript side? ASP.NET Webforms - Unit Tests are near impossible when the coder does...

Is MVC .net right for my project type?

After countless hours researching (creating a few demo projects, viewing webinars etc..) I feel like MVC .net works great for 90% of the web application types out there, but not for mine. Basically I have a dashboard application where I'm displaying large amounts of information in many different graphs / charts (all on the same screen)...

how to open a pdf file from a shared folder from a controller in MVC

how to open a pdf file that is placed inside a shared folder on my drive from a controller's ActionResult in MVC ...

404s for asp.net mvc solution doesn't work in production

I used Shay Jacoby's solution to route 404s and 500s and it works great on my dev box: http://stackoverflow.com/questions/619895/how-can-i-properly-handle-404s-in-asp-net-mvc/ However, in production, it only routes 500 errors and 404s still get the default iis 404 messages. I think I'm missing something simple, any ideas? I deployed t...

Why am I getting "The directive 'control' is unknown" error in ASP.NET MVC?

Hey SO, I'm working on an editor page for a project in ASP.NET MVC. I would like to use a control for both the create page and the edit page so I don't have to duplicate code. I've set up an EditorTemplates folder inside /Views/Shared to hold my templates. And I've placed a .ascx file in there called ArticlePresentation.ascx. ArticlePr...

What could I do to improve my MVC?

I'm thinking of re-working my MVC before I get to far along with it. At the moment it uses a sinle controller which takes the user input and determines the model. The model has maby differ methods which I call actions, because one is called automatically. The model loads its view file, which again holds many different methods. The model ...

asp.net mvc jquery paging plugin

can some lead me to best jquery asp.net mvc paging plugin ? can some one tell me that http://tablesorter.com/docs/index.html paging plugin in there can be intergrated with asp.net mvc ...

Making my code easy to write plugins for

Hi all, I have been writing some code that creates a generic blog. Its features are simple, create a post, edit and delete the post and allow comments. I am trying to write it so that it is very easy to write plugins for, however Im not sure on the best approach. Some of my ideas: Have the plugin author write a short script call...

Login/Authorization best practices in a PHP MVC environment

I am working with a homebuilt MVC-oriented framework, and need to implement a login page. At the moment, the way it works is each controller that needs authorization calls its authorize() method, which in pseudo-code looks like: protected function authorize() { if (logged in) { return true; } if (login form submitte...

Server-side validation of a REQUIRED String Property in MVC2 Entity Framework 4 does not work

I'm trying to get server-side validation of an Entity Framework String Property to work. Other server-side validation such as data type validation and required dateTime and numeric EF properties are working. This in VS 2010, .Net 4.0, MVC2 + Cloud, ADO.Net Entity Framework. The String Property I am having issues with is mapped to a SQ...

Zend Framework _forward to other action inside same controller

How can i forward to other action inside the same controller avoiding repeat all dispatch proccess ? Example: If i point to User Controller the default action is indexAction() inside this funciton i use _forwad('list') ... but all dispatch proccess are repeated.. and i dont that Whats is the right way ? ...