asp.net-mvc

ASP.NET MVC Wizard, WCF and validation

I have an asp.net mvc wizard with 5 steps. My business model is implemented using DDD. The architecture of the web application is something like this.. View->Controller->WCF->DDD->Repository and Database. Business data validation is implemented in DDD, and WCF makes a call to it to validate data. I am finding that every step in the wiza...

Does File() In asp.net mvc close the stream?

Hi I am wondering if you do something like public FileResult result() { Stream stream = new Stream(); return File(stream,"text/html","bob.html"); } if File() would close the stream for you? Since I tried to put the "stream" in a using statement but it always gave me a error saying the stream was closed. public FileResult resul...

How to use Html.RenderAction in SparkView Engine?

I am getting an error when I use it like this !{Html.RenderAction("Action", "Controller")} I had to switch to webforms view engine and replace it with <% Html.RenderAction("Action", "Nav"); %> to get it to work. The error I am getting is "Cannot convert void to char" ...

Set new Default Folder / Controller

Is there a way to set a new Controller other than Home when a condition is met? I want to be able to specify a default controller other than Home when a user is logged in. So before a user logs in I want to use the default Home controller but once they have logged in I'd like to use say the User controller. Better yet is there a way t...

MVC - No Viewdata item with key of type 'IEnumerable<SelectListItem>'.

I'm new to MVC and ASP.NET and am looking to learn a bit, so I'm trying to make some trivial applications to learn the ins and outs. Well, I'm trying to make a dropdown box show a list of books where it would show the title of the book but post the book_id [primary key] The error I get is:: There is no ViewData item with the key 'book_...

Elmah does not work with asp.net mvc

I spent countless hours trying to get Elmah working with asp.net mvc, but can't get it working 100%. Right now all the logging works fine, but the HttpHandlers are all screwy. Everytime I try and log into an admin account I automatically get redirected to Elmahs listings page. It makes no sense because the path for elmah is just elmah.a...

ASP.NET route passing string value

I'm trying to have a page on an ASP.NET MVC based web site where one page allows selecting by username instead of ID. I would have thought the route needs to be something like: routes.MapRoute( "CustomerView", "Customer/Details/{username}", new { username = "" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new {...

How to build an order processing form in ASP.NET MVC and jQuery/JavaScript

I need help with building page where information is entered on a form at the top of the page and then added to a grid below the form when the user clicks the "Add" button. The form will have drop-down boxes so the colums in the grid representing the selection should show the text of the drop-down and not the index/id. Once all data has b...

How can I deploy MVC App on IIS 5.1?

Hi, I want to deploy an MVC application on IIS 5.1. I am using MVC 2. How can I do so? It seems bit difficult? regards, Kaps ...

Map ViewModel / partials with AutoMapper

I have created presentation model and I want to map it (with AutoMapper) into the ViewModel. ViewModel is composite / because I'm using partials and I want to reuse for example KeyboardsViewModel also on other views/partials. How can I map (setup mapping) this presentation model into the ViewModel? Is this the right approach? Thanks! ...

asp.net MVC - Default route doesn't appear to be working

Hi there, I have setup some routes and they work so if i put localhost/MyWebApp/Reservas ...... it works. I have setup up a default route that if somebody enter localhost/MyWebApp it should go directly to the Reservas route ... but it doesn't.. I have installed a route debugger and it appears nothing matches the request.. am i doing ...

How to store temporary data from one request to the other in MVC

In some requests, external data has to be fetched from Soap service. Obviously I don't want to get that data at each call for the same user. What is the best practice to store temporary data from one request to the other? The data could take up to 10 meg. ...

Route with nullable parameter problem

Hello I have a page where you edit "usergroups". And I have this in my controller: public ActionResult UsergroupEdit(int? usergroupID) both edit and create on the same view. and in global.asa: routes.MapRoute("AdminUsergroupEdit", "Admin/Usergroup/Edit/{usergroupID}", new { controller = "Us...

Sorting, Filtering and Paging in ASP.NET MVC

What is the best approach to implement these features and which part of project would involved? I see some example of JavaScript grids, but I'm talking about a general approach which best fits the MVC architecture. I've considered configuring routes and models to implement these features but I don't have a clear idea that if this is th...

ASP.NET MVC - Submit Form with complex Model with EntitySet

Hello There, I'm struggling myself trying to make my form work with my models... So, I have 3 Models Account has_one -> Company has_many -> Individuals -> has_one Document So the account can have one company and many individuals with one document each. When submit my forms I have the following action [AcceptVerbs(HttpVerbs.Pos...

capture windows username in asp.net mvc request

i have an intranet app asp.net mvc site. is there anyway to capture the windows nt login from the user wihtout having a full login system in the site. i dont want permissioning but i would like to do some logging on the server to track requests, etc . . ...

Ambiguous Actions

Is there any way to have multiple actions with different parameters? I've seen it using the HttpPost verbs flag, but it doesn't seem to work for me in other places. The current request for action List on controller type FoldersController` is ambiguous between the following action methods. public ActionResult List() { //... } publi...

ASP.NET MVC Controller design

Let's have an oject structure like this : Company -> Department -> Person -> means 1:M relation Should I have one fat controller which serves all request for this objects or one controller per every object ? There will be the usual CRUD operations for each object. The details (Department,Person) will be displayed on one page using gr...

Deploying asp.net mvc web site

Hi! I have asp.net mvc web site. When i want to change some code in controller i need to build all the site and upload it to the server. Is there some merhods when i need just copy controller file by ftp? ...

ASP.NET MVC and ApplicationPath

Question is about paths and domains: I have an out-of-the box ASP.NET MVC project (generated by "File->New Project"). On LogOn page it does: return Redirect("~/Account/LogOn");. I have a domain name: mycompany.com, and following file structure on the server: /Root /MyApp (this is where my app goes into) Default.aspx ...