asp.net-mvc

jqgrid ASP.NET MVC -- getting data right for the grid.

Here is my dilemma, I have not been able to manipulate my data to a form fitting to jqgrid standards. This is my first time using the jqgrid and I've spent a lot of time reading up on it. My js code is as follows: jQuery("#list").jqGrid({ url: '/Home/ListContacts/', dataType: "json", conten...

How to defer to the "default" HttpHandler for ASP.NET MVC after handling a potential override?

I need to implement a custom handler for MVC that gives me the first look at URLs requests to determine if it should rewrite the urls before submitting the URL to the routing engine. Any pattern is a candidate for the redirect, so I need to intercept the URL request before the standard MVC routing engine takes a look at it. After looki...

in ASp.NET MVC, How do you remember a dropdownlists state?

I have this action: public ActionResult Add([Bind(Include = "Title,Description")] product product2Add){ --SNIP-- } I'm using a view model pattern where I've created a special "AddProduct_ViewModel" class that contains my product class and anything else I need in my view. That includes 2 dropdownlists; one that does a DB lookup of all ...

Branding / skin for ASP.NET MVC website

Hello, I'm planning to design simple website using ASP.NET MVC new technology. Many concepts are changed there comparing to classic webforms so my question is how to prepare website to be able to change its skin or apply different branding, preferably using for this purpose different dns request name? App_themes is not possible to use?...

Why doesn't my first radiobutton get checked?

I got the following Html: <div class="horizontalRadio"> <label for="SearchBag.DisplayTypeChips" id="DisplayTypeChipsLabel"> <%=ViewData.Model.T9nProvider.TranslateById("CommonWeb.Chips")%> </label> <%=Html.RadioButton("displayType", DisplayTypes.Chip, Model.DisplayType.Equals(DisplayTypes.Chip.ToString(), StringComparison.Invaria...

How to change default view location scheme in ASP.NET MVC?

I want to change view locations at runtime based on current UI culture. How can I achieve this with default Web Form view engine? Basically I want to know how implement with WebFromViewEngine something what is custom IDescriptorFilter in Spark. Is there other view engine which gives me runtime control over view locations? Edit: My U...

ASP.NET MVC Unit Test

Hi, I'd like to try unit test in ASP.NET MVC framework. But I don't know which unit test framework I have to choose. NUnit, xUnit.net, MbUnit. or the unit test framework included with Visual Studio, which one is better? ...

Problems with model using LINQ to SQL when adding a strongly typed view

I am trying to create a simple task manager solution based on the Nerd Dinner tutorial weblogs.asp.net/scottgu/archive/2009/04/28/free-asp-net-mvc-nerddinner-tutorial-now-in-html.aspx. EDIT: I have removed the http:// on these urls because I have not got enough rep to add links into a post. I have built my model as shown here: nerddi...

How to separate model, view and controller in an ASP.NET MVC app into different assemblies

Hi, At the moment I am trying to get into the ASP.NET MVC framework. For most of my test applications I used a single assembly/project. This worked fine for some smaller applications. Then I wondered how I could place my model, controller and view classes into separate assemblies? In really big web-applications it is not very realistic ...

Multiple or Single Repositories with LINQ

I've been reading Chapter 11 (Testable Design Patterns) in the Professional ASP.NET MVC 1.0 book. In the examples in this chapter, data access is split into a number of repositories: IOrderRepository, IProductRepository, etc. That all makes sense: a single repository for a single class of data. However, this breaks down somewhat for me...

Return PartialView and Javascript from Controller

I see there is a question here but there is no definite answer. Has anyone any ideas how to return a PartialView with Javascript or JSON. I am doing an AJAX post, on success it renders the PartialView but then needs to run some javascript or check the JSON result. ...

Disable selection box without removing value from post

In my current asp.net-mvc project one of my pages allows the user to select a value in a dropdown box after wich a post request is made that updates several values. To make sure the delay from the postback doesn't confuse the user into selecting another value (and thus creating another post, creating another delay etc) I set the select's...

How to Debug the White Screen of Death in ASP.NET MVC

I have recently upgraded my ASP.NET MVC application from beta to version 1. And true enough, after I fixed all the references, I got a white screen of death when I pressed F5. Is there any idea how to debug white screen of death in VS 2008? ...

Html.ListBox

Hi I am trying to re-select items in a listbox with asp.net mvc Html.ListBox("SupplierId", new SelectList(Model.Suppliers, "Id", "Name", Model.SelectedSuppliers)) Here is the viewdata var viewData = new ViewData.SubstrateEditViewData( new DataAccess.SubstrateRepository().GetItemById(id), ...

Render an action that returns a partial view in a view.

Suppose I have an action that returns an rendered asp.net mvc control and send it as a response for AJAX request. I want to have the response of that action during the whole page is rendering in a view. public class Controller { .... public ActionResult AjaxAction(string parameter) { return PartialView("~/Views/Controls/Con...

Modelbinding of IList in ASP.Net MVC Final Release

There are a lot of examples on how to use the built-in Model-binding capabilities to automatically get a List of items. But they all refer to the Beta-releases of ASP.net MVC. It is also mentioned that there has been a change in this Model Binding but so far I was not able to find a good source on how it now works in the Final Release. A...

Why Strongly Typed Html.ActionLink is Not in ASP.NET MVC 1

OK, Microsoft removed strongly typed HTML.ActionLink from the main ASP.NET MVC assembly in beta because "of some features that can still evolve in future release of ASP.NET MVC" But now MVC is officially released, why the strongly typed HTML.ActionLink is still not back? ...

How To: use Actionfilter to create thumbnail like HTTP Handler

hi, sorry for the lame question but with HTTP handler it is easy to do that, just intercept an image file and parameters and HTTP handler will do it for you like for example the question is how you can do that with ActionFilter and let it intercept any image ? thanks in advanced. ...

MVC redirects authorized users to wrong url after timeout.

I have published my MVC project to an an IIS 6 server. Running under the application MVCapp. The web project gets the url: www.domain.com/MVCapp/. I use forms login for authentication and got an issue after publishing. The web.config is as follows: <authentication mode="Forms"> <forms name="CTWebCookie" loginUrl="~/Account/Login" def...

Authorized View or Configure View as Authorized?

Is it best to create a separate view for authorized and unauthorized even if there will not be a lot of additional information in the authorized view? Or should there be one view and with model data adjusted accordingly? EDIT: In MVC, I believe it better to have 2 views and then use partial views for the duplicate information. agree? ...