mvc

asp.net mvc regular expression

(@"^\w+(?: \w+){0,8}$" the above regular expression restrict all the special characters except _ . how would i restrict it. ...

Swing MVC JTextPane and in generally for others

In a JTextPane what are the MVC components? Also if I wanted to know for a JComponent their MVC parts how can discovery them? ...

Why do I need MVVM for WPF/Silverlight, is there any good reason one cant use MVC?

Maybe I'm crazy, but I get MVC. It makes sense. MVVM seems like a way to make MVC harder, am I wrong (if so, why?)? ...

Using an HTML button in MVC

I feel a bit stupid asking this, but I just want to know how I can have a html button call a server site action on my controller. For example lets say I have a Text Area and a submit button. The idea would be to click the submit button and the text in the text area would get submitted to the Database. Very simple stuff. Thank you for t...

Introducing MVC into ASP.Net - 404 error

I have an existing ASP.Net Application, into which I am attempting to introduce MVC2. Hopefully I can remember the steps, but what I did was the following: Created a dummy MVC2 project. Compared and merged .csproj, resulting in the Add Item commands showing MVC2 items. Compared and merged the web.config Compared and merged the global....

mvc 2: filtering online vs offline users

I understand that I could show online users using ajax. For example, I could detect and display if the user has been online or offline for last 5 minutes or 15 minutes etc. How do I filter the users by online vs offline? Or How do I filter the users by offline since 5 minutes, 10 minutes, 15 minutes etc etc.?? Since this logic will b...

CakePHP not showing flash() messages?

I am writing a CakePHP app but it doesn't seem to be showing flash() messages on any of the pages. I am using $this->Session->setFlash(); to set flash() messages and using $this->Session->flash() in my default template, as well as $this->Session->flash('auth') on the login and registration pages but they don't show the validation errors ...

How to allow some specfic character from long text in telerik column

hi I have an aplication in asp.net MVC and using telerik grid for displaying the record. Now one of my field has some large text about 1000 character due to which the text is getting extended vertically and layout is not looking good. Is there any way to show some specific number of character in the column and show the whole text in a t...

IE div, updatetargetid not refreshing on subsequent requests

I am facing an issue while showing the partial view in div with updatetargetid property of Ajax.ActionLink. This is my controller- [HandleError] public class HomeController : Controller { static NumberViewModel model = new NumberViewModel(); public ActionResult Index() { model.IsDivisibl...

Fill jqgrid with data from visualforce page

I have a visualforce page and I am using jqgrid to display data on this page. The url that the jqgrid points to is a visualforce page(https://test.visual.force.com/apex/GridResults) which outputs only JSON data. This page does not have any header or html information. The problem is that when I run this page, the grid renders with colum...

Java MVC Web development framework ?

Hi all I want to develop a website with java but I'm absolute begginer in java web development. I want to use a framework that uses the MVC pattern and Ajax. I did some search and found that Spring or Struts are suitable but I'm not sure. could you please recommend a framework ? Thanks ...

MVC model design?

I have just been reading about the MVC design pattern for Cocoa-Touch applications and it suggested using a property list for the model. My question is if you needed to do some calculation on the data in the property list where would the code for that calculation go? In the past I have used a singleton object for my model and then used ...

mvc application design tips

background: i came on board to a team/ project that have developed a .net home grown mvc type architecture with home grown Ajax calls to persist data in a series of 6 screens to a context object on the server to maintain state. question 1: this seems like using mvc just to say we use mvc and not the mvc way of doing things. it feels t...

asp.net mvc view user control for data capturing

I am tring to add a user control to do a search. this user control is to be used on the home page and for example /category-page. where do I write the code for data capturing. is there a way to force the user control to submit to a HomeController or the controller I want? I hope my question is clear. I have the following on the homeco...

Simple DropDownListFor in MVC2?

I've got a table that stores a True/False value as a sqlserver bit field (Featured). First, is there a better way to generate a dropdown list for this other than manually? Second, here's what I've got so far which works but does not add selected="selected" to any items in the DDL. Edit 1: I've updated this example according to the ans...

Passive view in JavaScript

I'm thinking about an implementation of MVP - Passive View pattern in JavaScript. In most case the view will be simple dom elements where the presenter attaching event listeners. But when it comes to widgets like JavaScript based pseudo selectboxes, auto suggest or aria features, should this be part of a JavaScript view class or should ...

Caching MVC .NET 4.0

Hello, I am trying to cache a selectlist which is not null but I get a null exception error. The line of code causing the error is: (note item is created using Cache item = new Cache(); and tripVM.friendDropDown holds the selectlist item.Insert("friendDropDown", tripVM.friendDropDown,null,DateTime.Now.AddMilliseconds(10000), TimeSpa...

How to make an MVC AttributeFilter to verify posted file extension

I have a controller that handles file uploads. Ultimately I would like to be able to create attribute to decorate my controller actions like [HttpPostedFileType("zip")] or something similar. Currently I created this extension method which I use in the action. public static string GetFileExtension(this HttpPostedFileBase file) { ...

Cross controller function conventions for MVC web?

I have a question about the best practices of placing certain functions in controllers in an MVC web framework. Lets say I have a User & Tags controller. I have a function/method called addTag_to_user(). What is the conventions or best practices for placing this in either the Users or Tags controller? Though personally I am more incli...

Rails: Does this belong in the model or controller?

I have a method which runs several rake commands. Does this method belong in the controller or in the model? My intention is to run this method upon every Save or Update ...