asp.net-mvc

Minify Action Filter Attribute in ASP.NET MVC

I have a controller action that returns a large amount of dynamic JavaScript (gets served once to the client) and I already have GZip compression enabled. One thing I'd like to do is read the executed result stream and apply JS minification on it. Is it possible to do this using an Action Filter Attribute. I think my question boils do...

Jquery ajax post to MVC2 action.

I'm using the following script to post to and endpoint, it's hitting the breakpoint on the server so I know the routing is correct. $(document).ready(function () { var o = new Object(); o.message = 'Hi from the page'; $.ajax({ type: 'POST', contentType: 'application/jso...

ASP.NET MVC jQuery DatePicker Navigate to page on select date

Hi, I'm using the JQuery DatePicker as a little Calendar Dashboard, marking dates with "agenda items" (events, office closed, meetings ...). The dates are marked and clickable, but now I'd like to navigate to the "Day Detail" when the user clicks on one of the dates. Here's what I have so far, but I'm missing (see ???) how I can appen...

automapper + lazy loading + mvc contrib grid + s#arp repositories

Hi, I am using the nice s#arp repositories and the paging extension method plus sorting like this: public ViewResult Index(int? page, GridSortOptions sort) { ViewData["sort"] = sort; if (!string.IsNullOrEmpty(sort.Column)) { return View(this.LabService.GetAllLabs().OrderBy(s...

Dynamic creation of models - entities using Asp.Net MVC

So, i have my database sorted like: Products_001 Products_002 Products_003 Let's say, if a customer logs in and his id is 001, he is only entitled to use the database-table products_001. Can i dynamically create his model - entity using Asp.Net MVC, and how would i do this? ...

Help! Why do my IE users get randomly logged off?

ASP.NET MVC 2.0, here's my auth code: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Login(string username, string password, string returnUrl) { if (ModelState.IsValid) { // Attempt to login var loginSuccessful = provider.ValidateUser(username, password); if (loginSuccessful) { FormsAuthentica...

SparkViewEngine spontaneous NullReferenceException while rendering view

We are using the latest stable release of SparkViewEngine for www.stribe.nl. There is a problem that occurs -sometimes- while rendering the homepage. When you look at the homepage it will usually render perfectly fine, but i noticed some exceptions in the EventLog from people visiting the homepage. The exception message is "Error execut...

What's important to know while using new { attribute = value } with Html.Helper actions

Hello, I've difficult to used new { attributes} in an HtmlHelper function. I'd like, for instance, to widen a TextBox. Should I use new { width = "50px"}, new { width = "50"}, or new { width = 50}, etc. How many atttribues can I use? What's the general rules? Thanks helping ...

JavaScript action result no longer working after converting to partial view.

Early yesterday, the following validation notice was working correctly. Then we converted the Index view where the request for this action originates to use a partial view, and the Delete ActionLink is now inside that partial view, and now the string argument to the JavaScript method call is rendered literally and as the only content on...

Multiple file uploads asp.net mvc

Hi All, I am facing one serious problem Technology: Asp.net mvc I am trying to upload multiple files from the dynamically created file upload control from javascript.(Attach more file Options).My files are not getting posted to the mvc controller action.i have specified the propert new { enctype = "multipart/form-data" } in my form st...

Edit one model on the view page of another - ASP.NET MVC

I am writing a basic blogging application in ASP.NET MVC. I have a Post model which can be displayed via View.aspx. On that page I also want to have a form to submit a comment, but as View.aspx inherits the Post model, I don't know how to have it edit a Comment model. ...

Deploy ASP.NET MVC application in IIS

Hi, I have planned to develop a web application using MVC, can any one suggest me the how easy to deploy the application on the IIS? And also let me know the steps to that. regards, Satish ...

Facing problem in creating dynamic file upload control in asp.net mvc?

Im creatng dynamic control of file upload so user can upload more than one file. But when i add more than 5 file upload control and submit the form. Error occured and shows The connection was reset The connection to the server was reset while the page was loading. what can be the issue? ...

C#, ASP.NET MVC / MVC2: Add wildcard route for specific controller - help building route

Hello, lets say I have a controller named Store. There is an index method: public ActionResult Index(string val, long? id, int? id2) { return View(); } I want to fetch things like: /my-store/some-text /my-store/some-text/ /my-store/some-text/123456789012335 /my-store/some-other-text/4562343462345 /my-store/some-other-bla-text/456...

html helper takes a dictionary<string,object>, how to use this parameter?

If a html helper takes a idictionary as a parameter, how do I use it? I tried: <%= Html.Blah( new { id = "blah" }) %> But that doesn't work. ...

Using MvcSiteMapProvider to create menu

Hi. Sorry if this seems like a novice question. I'm trying to create a navigation menu that will be displayed in every page of my mvc site. I'm using MvcSiteMapProvider, and the general idea is to create a general ApplicationController, which every controller inherits. public abstract class ApplicationController : Controller { publ...

using Ninject with ASP.NET MVC and services layer

I have an ASP.NET MVC project which uses a services project to go through a set of interfaces (project) to a repository project. I am slightly confused where to use Ninject. It seems logical to me that i include my Ninject in the services layer as this is where i interact with the interfaces. My question is how would this be implemen...

How do I use Asp.net MVC to validate a list property has a minimum number of items (count=N)?

I have a view model that has a property that looks like this Property SelectedGroups() as List(of string) In the view I have something like this <table> <tr> <th>Description</th> </tr> <tr> <td> <input type="hidden" name="SelectedGroups" value="one" /> description one </td> ...

MVC 2 UpdateModel on Interface, Should ModelBinderAttribute be ignored?

I have forms posting data from instances of a particular abstract class: public abstract class IRestriction { public string Name {get; set;} public abstract IModelBinder GetBinder(); } The concrete type and PartialView are determined at runtime: IRestriction restriction = (IRestriction)Activator.CreateInstance(Type.GetType(re...

asp.net mvc how to design a complex form that requires search results from a different controller

Hi, I want to create a form for creating an order. So I have an 'Order' controller. One of the first steps will be to select an existing person to send this order to. I'm thinking the Create() action method on OrderController will put a new Order object in session. Then I'll need a link that will redirect to another controller, the...