asp.net-mvc

Request a file download from an ajax call

Is it possible to make an ajax call (using Jquery) to request a file. (The ajax call passes back a chunk of information) the Server reponds by sending a file or an error message. If the server sends the file I would like the browser to handle the request so you get the browser's standard file download action. Is that doable? Or is it ...

Deleting unreferenced child records with nhibernate

Hi There I am working on a mvc app using nhibernate as the orm (ncommon framework) I have parent/child entities: Product, Vendor & ProductVendors and a one to many relationship between them with Product having a ProductVendors collection Product.ProductVendors. I currently am retrieving a Product object and eager loading the children...

Remote Debugging on IIS - Access Denied Nightmare!

Hi. We have two Win2k3 servers here, one is a domain controller and the other our webserver. I'm running an ASP.NET MVC web app setup as a website in IIS on the webserver. I've copied across the x86 remote debugging tools to the webserver, logged in to an admin account and ran msvsmon. I added the user I'm logged into my workstation ...

Can we use Resource Expressions in ASP.NET MVC

When I try to use <%$ Resources:Resource1, Name %> in the view, I am getting an error like Literal expressions like '<%$ Resources:Resource1, Name %>' are not allowed. Use <asp:Literal runat="server" Text="<%$ Resources:Resource1, Name%>" /> instead Ta, Rajeesh ...

Testing controller Action that uses User.Identity.Name

Hello, I have an action that relies on User.Identity.Name to get the username of the current user to get a list of his orders: public ActionResult XLineas() { ViewData["Filtre"] = _options.Filtre; ViewData["NomesPendents"] = _options.NomesPendents; return View(_repository.ObteLiniesPedido(User.Identity.Name,_...

How can I make Html.DropDownList encode its values?

In my viewData I have an IList mls. I want to use this to show in a dropdown. Like so: <%= Html.DropDownList("ml3Code", new SelectList(Model.Mls, "Code", "Description", Model.Ml3.Code ?? ""), Model.T9n.TranslateById("Labels.All"), new { @class = "searchInput" })%> This works fine, until there's a myObj...

ajaxhelpers versus jquery

has anyone done any comparison between ajax helpers and jquery. there seems to be a lot of overlap and i wanted to see if anyone did a breakdown on which is better. ...

lessons learned or mistakes made when using asp.net mvc

what are your top lessons learned when starting asp.net mvc that you would highlight to someone starting out so they can avoid these mistakes? ...

MVC - Set selected value of SelectList

How can I set the selectedvalue property of a SelectList after it was instantiated without a selectedvalue; SelectList selectList = new SelectList(items, "ID", "Name"); I need to set the selected value after this stage ...

Best Place to Put SelectListItem Generators in ASP.NET MVC Application

In my first venture into ASP.NET MVC, I am coming across a few situations where I have dropdown lists that are limited in their purpose to a single view. A good example is that I have a signup form where a user has to put in their gender and birthdate. Once entered, nowhere in the application is it changed. For the gender, I build out...

help with jquery in asp.net mvc

I have been using telerik extensions for an asp.net mvc project, more specifically the tabs. Im loading my tabs contents via ajax. One of my returned ajax files is a form that has a date field. I want to be able to use telerik datepicker but it doesnt work. Im sure it has something to do with $(document).ready() already being executed...

HttpModule with ASP.NET MVC not being called

I am trying to implement a session-per-request pattern in an ASP.NET MVC 2 Preview 1 application, and I've implemented an IHttpModule to help me do this: public class SessionModule : IHttpModule { public void Init(HttpApplication context) { context.Response.Write("Init!"); context.EndRequest += context_EndRequest...

asp.net mvc Forms Collection when submitting

what is the best practice for submitting forms in asp.net mvc. I have been doing code like this below but i have a feeling there is a better way. suggestions? [AcceptVerbs(HttpVerbs.Post)] public ActionResult AddNewLink(FormCollection collection_) { string url = collection_["url"].ToString(); string descrip...

MVC User Controls in Standard ASP.Net

This may be a rookie question but if I have created a suite of user controls in MVC, can I reuse them in non MVC projects? The reason I ask is because where I work we have multiple projects and not all of them can or will be converted but I'd like to show the powers that be that anything I do in MVC, with user controls, can be reused in...

ASP.NET MVC: Passing a user control a list of 'something'

I'm wanting to have a strongly typed user control that accepts the class PaginatedList<T> What will my signature for this user control look like and how do I render it? At the moment I have this as my signature for the user control: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Project.Models.PaginatedList<Project...

MVC validating multiple forms

Hi all In my MVC application for booking accommodation I have the following: Action to display the selected room with input-forms for extra info GET:"Details" This view has multiple forms on it, each posting to a different action. Examples: Action to update the number of guests POST:"UpdateGuests" Action to select start date POST:...

Full folder path prefixed to application root for MVC at GoDaddy

I am having a similar problem as described here: stackoverflow.com/questions/364637/asp-net-mvc-on-godaddy-not-working-not-primary-domain-deployment I have multiple domains pointing to different folders. Each folder is set as an application root in IIS7 on GoDaddy's shared hosting. These folders are [ContentRoot]/websites/folder1, [C...

RedirectToAction between areas?

Is there a way to redirect to a specific action/controller on a different Area? ...

Partial Record Updates with Linq to SQL and MVC

Let's say I have a DB table with columns A and B and I've used the Visual Studio designer to create a Linq objects for this table. All fields are marked NOT NULL. Now I'm trying to edit this record using typical MVC form editing and model binding, but field B doesn't need to be editable, so I don't include it in the form. When the pos...

Help with 2-part question on ASP.NET MVC and Custom Security Design

I'm using ASP.NET MVC and I am trying to separate a lot of my logic. Eventually, this application will be pretty big. It's basically a SaaS app that I need to allow for different kinds of clients to access. I have a two part question; the first deals with my general design and the second deals with how to utilize in ASP.NET MVC Primaril...