asp.net-mvc

are strongly typed user control views not allowed asp.net mvc?

Here's the setup - I have a view that lists products. On that same page I have a user control view that lists categories. I pass the list of product to the view like so: return View(myProducts); The user control view gets the data it needs via ViewData["Category"] Now if I try to use a strongly typed user control view like this: <%...

ASP.NET MVC retrieving route to controller, action and parameters

In ASP.NET MVC how can I generate a URL to a specific controller and action along with other parameters. The RedirectToAction allows me to redirect, but I would like to retrieve this URL instead from within my controller. I tried using: Url.Action("Page", "Administrator", New With {.page = _currentPage}) But that returned a link like...

How does the DiggBar work?

How does the DiggBar work? I'm trying to make an ASP.NET MVC DiggBar clone just for learning purposes and does anyone have a suggestion on how to specify the url of the content for the lower frame? How would you go about constructing that in MVC? Also, I know that it is an iFrame, but how do they position it so regardless of scrolli...

Read multiple variables from data object returned with ajax

I am making a jquery ajax call to an mvc controller. I want to return 2 or more variables from the controller. How do I package data in controller for this ? how do I extract with jquery? ...

problem with mvc beginform

Hi all, I have two dropdowns in my form. Selected values from this dropdowns should be send to the proper route. One is called "category" and second is called "status". When I send my form I don't get expected: Home/List/category/status adress but something like this: Home/List?category=category&status=status how I can solve this? t...

Is ASP.NET MVC 1.0 Futures beta/preview code?

I understand that the "1.0" in "ASP.NET MVC 1.0 Futures" means that it is the ASP.NET MVC Futures built against the ASP.NET MVC 1.0 RTW (final/release to web). What I'd like to know is whether the Futures code is solid enough to treat as 1.0 / gold quality? We're about to jump into ASP.NET MVC for the first time and it came up that we s...

ASP.Net MVC - how to handle exception in JSON action (return JSON error info), but also publish the exception for filters?

I'm using a filter to log exceptions thrown by actions which looks like this: public override void OnActionExecuted(ActionExecutedContext filterContext) { if (filterContext.Exception != null) { //logger.Error(xxx); } base.OnActionExecuted(filterContext); } Now I'd like to handle all my JSON actions to return JSON resul...

Website localization depending on its extension

Hello, I'm currently building my personal website in ASP.Net MVC and I want two versions: a French and an English one. I've got two domain names and I want to match the English version to the ".com" domain and the French version to the ".fr" domain: When you go to www.mywebsite.fr, you will get the French version When you go to www.m...

MVC - How to put random images from a folder on the master page.

Hi, I have an MVC app and I want on the top of the master page to have a series of random images from the folder. To do this I have to write code but not where to write the code?? It has to be done in one place. I will probably just set the images at the beginning of the session so they are cached by the browser and improve performan...

How to assign controller name and action name dynamically in asp.net mvc

How to assign controller name and action name dynamically in asp.net mvc ...

ASP.NET MVC

How to change default action method inside the ActionInvokeMethod of ControllerActionInvoker class? ...

ASP.NET MVC Controller Action Executing 4 Times Per Request

Has anyone come across something like this before? Basically, I have an action on a controller that merely queries the database via a repository pattern, adds some data to the ViewData then returns the View. But for some reason this action is being called 4 times per request. The whole action itself is only about 10 lines long: public ...

Hyperlink Rewriting with Javascript/Jquery

Here's what I"m trying to do. I have a hyperlink like this on my page: <a href="http://www.wikipedia.com/wiki/Whatever_Page_Here"&gt;Whatever Page Here</a> When a user clicks the link I want to grab that click. If it's a link I don't want them to click (like something that doesn't match the format http://www.wikipedia.com/wiki/xxxxx) ...

ASP.NET MVC Views don't see any classes after massive refactoring

My project went through a name change, which led to using ReSharper to change the name of namespaces throughout the solution. Everything compiles just fine, but my ASP.NET MVC views are no longer seeing any inherited classes. I've changed the namespace imports in web.config and everything, and I'm certain that the classes exist. They wor...

What files do I need to deploy for ASP.NET mvc?

I know I can just copy all of my files from my development environment into my live website directory, but then I know I'm copying several files that aren't necessary (e.g. the .sln file and .csproj files). What files actually have to be copied for ASP.NET MVC web applications to run? (E.g. Do I need to copy all .CS files?) ...

Why does ASP.NET MVC path appear with variables?

In my MVC app, why does Return RedirectToAction("Edit", "Forms", New With {.member = "123"}) return http://localhost:13/Forms/Edit?member=123 insted of http://localhost:13/Forms/Edit/123 ? And why does <%=Html.ActionLink("MyLink", "Edit", "Forms", New With {.member = "123"}, Nothing)%> do the same thing? ...

Async requests to model-bound action methods with JQuery

I have an ASP.NET MVC action method which uses model binding to accept a strongly typed model object as its input, i.e: public PartialViewResult SaveUser([Bind(Prefix = "User")]User NewUser) { } How do I specify the argument when requesting this method asynchronously with JQuery? I have previously used the load() or post() methods to ...

How to perform property injection with Unity and asp.net mvc on action filters?

I am trying to get dependency injection working on my action filters with property injection. I can't figure out how to automatically set dependencies on the filters. Here is the code I have so far. public class UnityActionInvoker : ControllerActionInvoker { IUnityContainer container; public UnityActionInvoker(IUnityContainer ...

ASP.net MVC RTM - "project type is not supported"

After installing ASP.net MVC, when I attempt to load a existing or a new MVC application (straight from New Project - A project for creating an application using the ASP.NET MVC framework (1.0) (.NET Framework 3.5)) I get the following error: Microsoft Visual Studio The project file 'path' cannot be opened. The project type is not ...

ASP.NET MVC Forum Software?

Hey Guys, Wondering if anyone knows of - or has got there has on - any ASP.NET MVC Forum Software? Codeplex yeilds a few results, but none of them actually have any releases ? Cheers ...