I'm using AutoMapper to map between a Linq Domain object and a ViewModel to display an Edit Form to the user which works perfectly.
When they click submit I'd like to know the best way to map the ViewModel back to a Linq entity and persist it to the database.
The Linq entity I'm using has multiple collections of other entities (ie one-...
I'm currently working on a portal using jquery portlets/sortable/draggable that also includes a content management system, all in MVC2. Only administrators are able to change the layout/content of the site currently.
Each view gets the personalization for a page (from the base controller) based on Controller and Action. Then the view lo...
I have 2 urls /Data and /Data/{month}/{day}/{year}.
I've created two routes
routes.MapRoute(
"Data_Name",
"Data",
new { controller = "Data", action = "DataForAnyDate" }
);
routes.MapRoute(
"DataFullDate",
"Data/{mon...
i have 2 links for switching culture.
if i click one link, the program call a method with this code:
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(ln);
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(ln);
return RedirectToAction("index");
If i look with debug the culture i...
I have a bit of a problem that's been driving me batty.
I have a page which generates a list of checkboxes based on a search. Also within the page is a dialog box designed to show up when a button is pressed. What I'm trying to do is get values from the checkboxes and pass them to a controller action which then returns the partial for t...
Hi
I new on MVC. I want to send values between view's and don't know how do this?
also I want send selected-item in grid to another view.
...
I have this C# regex:
^\s?((?<qty>\d+)\s?/)?\s?[$]?\s?(?<price>\d{0,2}(?:\.\d{1,2})?)\s?$
and use MVC's data validation at the client. JavaScript says this regex is invalid, although C# works perfectly fine. Any idea how to get it to work for both C# and JavaScript, since it doesn't seem possible to provide a separate JavaScript Reg...
I've added some of my own helpers to the System.Web.Mvc within my project and got it working with the default asp.net mvc view engine. By defining the helper like
namespace System.Web.Mvc
{
public static class XSSHelper
{
public static string h(this HtmlHelper helper, string input)
{
return AntiXss.H...
Hello all,
I want to create a dropdownlist, but am struggling with how I display it.
I have the following code.
Controller
var trader = new DisplayTradersAttachedToCategoryViewModel
{
Description = data.Description,
Id = data.Id,
BusinessName = traders.Select(x =...
Hey everyone,
I've been reorganising our views at work and moving them around to more appropriate locations.
Because we're currently organising many of our views into their own folders within the Views folder, we're having to reference our views using the full path in RenderView.
Is there a way that I can get Visual Studio to throw a ...
Hi all,
I want to develop a web application using ASP.NET running on IIS.
If a user submits a MAXIMA input command, the code behind will ask a custom windows service to create a new distinct temporary process executing an external assembly.
More precisely, there is only one windows service serving for all users, but each user will be...
I'm rather new to MVC2 (never been in MCV1) though I'm a WebForms developer for some years now...
in my MCV 2 start project I created a App_Code folder that I would put my Business Classes on it, I also add 2 References to 2 DLLs used for the API I'm about to use.
But I don't get Intellisense on the referenced objects
What am I doing ...
I have a profile image upload page, where users can overwrite their previous profile picture.
But when I return the users to their profile page the browser has cached their previous image and only an F5 refresh returns the new image.
Is it possible to prevent the browser from caching the image, as some users might think their new uploa...
I'm trying to filter down the results returned by EF into only those relevant - in the example below to those in a year (formattedYear) and an ordertype (filtOrder)
I have a simple set of objects
PEOPLE 1-M ORDERS 1-M ORDERLINES
with these relationships already defined in the Model.edmx
in SQL I would do something like...
select *...
Hi!
I'm new to MVC!
I am trying to use two DropDownLists (Cities, Categories) in a PartialView that will be used in MasterPage, meaning they will be visble all the time.
I tried to load them in HomeCOntroller, but that didn't work. I got an Exception.
I read something about making a baseController that the other controllers will inh...
specifically, the default directory naming structure is [Controller]/[ActionMethod] resulting in a rendered url like www.mysite.com/home/actionMethodName.
What if I want to simply imply the Controller (in this example, 'home') so that I can get a url that looks like this: www.mysite.com/actionMethodName.
I haven't seen many requests fo...
To use your own ModelMetadataProvider you normally set it in the global.asax.
I'm using MVC Turbine and I need to inject a dependency into my ModelMetadataProvider as well.
Something like this:
ModelMetadataProviders.Current = new MyModelMetadataProvider(ISomeDependency);
How is this best accomplished with MVC Turbine?
...
I have the following code that was generated using scaffolding and IDJefe is an int in my database, but I want the end users to choose a name from a comboBox.
How could I accomplish this?
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SeguimientoDocente.Area>" %>
<asp:Cont...
Hi, i was wondering if it was possible to filter which action is invoked based on a paramater in the query string.
For example, i have a grid with a radio button column to select an item in the grid. The grid is wrapped in a form and at the top of the grid are buttons to edit/delete the selected item. Clicking on the edit/delete butto...
Does JQuery AJAX have a different User Session than a postback to the same website?
I am trying to send data to a MVC2 Controller through a Jquery Ajax POST with a querystring on it and then this MVC2 Controller will take the data from querystring and place it into the User's Session. Successfully while debugging I see that the Control...