mvc

Loading cache overloads database

When my site starts I open a second thread that loads lots of data into the cache. The web layer work as expected, but it leads to to much load on the database. Other queries are not served in reasonable time anymore. The DB is read only, so there are no locks involved. Is there a good way to tell my thread to take it easy? Something l...

MVC strong type view not returning values

Hi: I am using MVC and have created a strongly type model to post data to a page. The data combines and address and company information. I set the address ID and Company ID in the model information and send it to the view. The view may or may not display the ID's. When the form is submited the ID values the are not valid. get and d...

Efficient way to implement a client multiple file upload service

What is an efficient way to implement a multiple file client upload service? Are there any popular libraries for that? Basically I'm looking at a Web view, served a client, that would allow them to upload files: i.e browse their file system and choose say up to 6 files. Is implementing the above service better than a single file upload-...

asp.net MVC DisplayTemplates and EditorTemplate naming convention

Hi, I've got a couple of questions about the naming convention for the DisplayTemplates and EditorTemplates in MVC 2. If for example I have a customer object with a child list of account how do I: Create a display template for the list of accounts, what is the file called? When I'm doing a foreach( var c in Model.Accounts ) how do I ...

.spark views get copied to /bin/Views - why?

Building or publishing my ASP.MVC 2 application the .spark files in the View directories copied to /bin/Views/*. This redundancy seems to be useless as the app runs fine on the server even if I delete the bin/Views directory. Any idea how to prevent this behavior? My files are tagged with the default build action "Content" and the Vi...

How do I restrict a users access to an object?

Hi Sitepoint wizard people, Say we have an admin application that has multiple users and various objects. What I'd like to do is control access within the object itself - that is, it will behave one way for one type of user, and another way for other users. For example... Director Mike can override Reception user Sally's registratio...

MVC with JQuery: handling Session Expire

Hello, I have a question: How could I handle the session expire on a MVC application that has JQuery Ajax method calls on certain pages. The issue is the following: When the client reaches the session timeout, each of my controllers inherits a class that checks if the session is alive (looking up on some stuff like the site session, d...

Can I customise my data text field in an MVC SelectList for use with the HtmlHelper.DropDownList without having to create a new struct or class?

I am creating a SelectList from a List(T) class to use to populate a HtmlHelper.DropDownList in an MVC view, setting the dataValueField and dataTextField in the Select List constructor. The text that should be displayed doesn't excatly match one of the properties on my class and still needs to be manipulated. Is there any way of doing ...

How can I optimize MVC and IIS pipeline to obtain higher speed?

Hi, I am doing performance tweaking of a simple app that uses MVC on IIS 7.5. I have a StopWatch starting up in Application_BeginRequest and I take a snapshot at Controller.OnActionExecuting. So I measure the time spend in the entire IIS pipeline: from request receipt to the moment execution finally gets to my controller. I obtain 700 ...

How to go about with real GUI development with Java Swing and MVC.

I am creating a Blackjack Card game emulator. I am a SCJP,familiar with Core Java concepts. I have a very basic understanding of Java swings and awt. Already finished writing the basic game logic,a CLI logic. My design includes several classes like, Dealer,Player,Table,Card,Casino and some others.. Enums for Cards and suite. I have read...

Getting action filters list from base Controller

In Short: Does any know a way from the base controller to get a list of actionFilters being applied to the current executing action? The Long: I am using ASP.NET MVC 1.0 framework. I have a "RequireSSL" actionFilter that I've recreated for checking out, however, if someone leaves the checkout and goes back to the store I would like to...

Does Android UI development lend itself well to a particiular design pattern?

Does the Android platform lend itself well to a particular style of UI programming like MVC or MVP? Most of my UI experience is with spaghetti code on a very old embedded device or in GWT with MVP so I do not know where to start. ...

Linq To Sql Intellisense Property Names

If I had two tables such as this: Profile Table ------------- PK ProfileID int FK AddressPrimaryID int FK AddressSecondaryID int Address Table ------------- PK AddressID int Address nvarchar City nvarchar State nvarchar Zip nvarchar Notice, the profile has a two relationships to the same table, the address table. When I create my li...

MVC.net + subsonic Auto Generate MetaData Classes from TT

hiya Not a question but i dont have a blog and i have just created a new subsonic TT file that will generate the Metadata classes automatically for the subsonic classes so you can skip out some work when using dataAnnotation and CreateForModel etc so the first step is to amend your ActiveRecord.TT with the following using System.Com...

ASP.Net MVC Routing URL Generation

Html.ActionLink appends "Index", the action name to the end of the urls, but i would like to not have the index action listed in the default controller url (hope that makes some sense...) Not Wanted: /ControllerName/Index WANTED: /ControllerName Below is my routing setup: routes.MapRoute( null, ...

Data Transfer Objects VS Domain/ActiveRecord Entities in the View in RoR

I'm coming from a .NET background, where it is a practice to not bind domain/entity models directly to the view in not-so-basic CRUD-ish applications where the view does not directly project entity fields as-is. I'm wondering what's the practice in RoR, where the default persistence mechanism is ActiveRecord. I would assert that present...

Where to put methods that do simple date formatting

I have two models, BusinessHour and StaffHour that both inherit from Hour. In the BusinessHour and StaffHour models I do a 'find' to retrieve requested hours. After that I need to format each time to a specific format, which I have a method for. I'm trying to figure out where to put that method. It sort of seems like it would go in a H...

ASP.NET How to Post a Master-Detail Views

I need to post the data from an Order-Details Page.. I have a page with fields for Order Info. Inside it is a user control for the Details Info. New rows can be added to the details info. Here are the fields: Order Customer (textbox) Order Date (textbox) Details(multiple) Description (textbox) Qty (textbox) Price (textbox) Amount (...

How do I pass a textbox value to jQuery .ajax method?

Here's my jquery method: $.ajax({ type: "GET", url: "Home/GetSocialMentionBlogs/" dataType: "json", success: function (data) { var obj = JSON.parse(data); $.each(obj.items, function (i, item) { $("<strong><p>" + item.title + "</strong></p>").appendTo("#blogs"); if (i == 5) return f...

Java: GUI application with a background thread

EDIT: To make things clearer- I have an application that connects to a remote server and updates a GUI. The application uses the MVC pattern. 1) The remote server may send a message that updates the data model of my application. 2) The GUI controller classes implement the PropertyChangeListener interface, and listen for updates on t...