asp.net-mvc

Get absolute url using routing

Hi! This should be simple. I want to get an absolute Uri given the controller, action and other routevalues. In other words I want to do what Html.ActionLink does but without the anchor and I want to do it in my controller. ...

Refactor Html.DropDownList data source asp.net mvc

I am using Linq To Sql to populate Html.DropDownLists in a few different forms with code like; ViewData["EmployeeId"] = new SelectList(EmployeeRepository.Employees.ToList(), "EmployeeId", "FullName"); This all works just fine but I have this same code all over the controller for the get ActionRe...

Where and which data to save into session on an ASP.NET MVC 2 application?

I am having some trouble saving the state of my current view. Currenly I have several selectlist calling their own Action method on the controller that returns the Index view with the filtered model based on the values of the selectlist. I have also written a little FileResult action that creates a csv file based on the current model. ...

Subsonic MVC Template and Code Generation

hi, I am using Subsonic MVC Template from http://code.google.com/p/subsonicproject/downloads/detail?name=SubSonic%20MVC%20Template.zip&can=2&q= Here is a folder named [Code Template] which contains the .tt files for generating views and controllers. But that is giving me error "MvcTextTemplateHost not found" I want to generat...

Finding target of LinFu proxy object

This is pretty much a duplicate question but instead of using Castle Dynamic Proxy I'm using LinFu http://stackoverflow.com/questions/1415675/getting-underlying-type-of-a-proxy-object I'm using automapper to create proxies of interfaces that I'm sending to my viewmodel in Asp.net MVC. My problem is from what I can tell that MVC's defau...

Handling subtypes in ASP.NET MVC

Hi, I can't think of a "best" way of handling the following situation - basically, I have a bunch of stored objects that inherit from a base type and would like to be able to retrieve one from storage, find its subtype (perhaps via "if(x is y)") and then act accordingly - some using a shared implementation, others with dedicated logic an...

Helpers are our "Custom Server Controls"

Is it my understanding that Helper methods are really the place where you can do the hard core logic that we would have done in lets say custom controls in ASP.NET? For instance I work for a .com which uses classic ASP.NET. The nature of our site is VERY complex, so we reuse and render different forms for thousands of products. Every ...

Do you store your helper classes in a separate assembly?

I just want to know if anyone stores their helper classes or methods in a separate assembly and why...just for clean management of them? I've seen so many posts about using a helper folder inside your MVC project and that brings me back to the messy old days in ASP.NET where people were using an App_code folder instead of cleanly separa...

ASP.NET MVC 2: How to contain List<> ID numbering within a "class" UI template?

Edit: I am trying to bind a single view model object that contains a List to a form so that the post maps back to the same view model object. Is there any code out there that could effectively do this in MVC 2? EditorFor( m => m, "Students", "Students[n]") // wrong but sorta close // the third parameter specifies the ID of the html con...

Controllers != Business Layer?

So I'm assuming people still use a business layer outside just controller logic? If so where's that grey line drawn and what do you not put in your controller classes that you would in your Business Layer project and vice versa? Seems to me like Controllers rid the need for a business layer in your MVC application totally. ...

How to realize adding a new page in the asp.net mvc website without coding

How to realize adding a new page in the asp.net mvc website without coding. ...

Can't submit form automatically for Incremental page load in ASP.NET MVC

When I submit form using button it works fine (renders PartialView in the menuload div): <% using (Ajax.BeginForm("Menu", null, new AjaxOptions { UpdateTargetId = "menuload", HttpMethod = "POST", LoadingElementId = "status-waiting" }, new { @id = "menuFormControl", enctype = "multipart/form-data"})) { %> <input id="m...

Is there any way to pass Context into HtmlHelper extension?

Im working on my new Helper, which extended from HtmlHelper. In my method, i need to call out data from Context. The context can be called from the View, but is there anyway i can just call it in HtmlHelper? The application is writen in ASP.net MVC 2.0 RC2. Thanks for your time. :) ...

CSS, Javascript and Images have zero length

Hi, I'm trying to port an ASP.NET MVC 1.0 / Visual Studio 2008 project to ASP.NET MVC RC 2 / Visual Studio 2010. The project is (and has always been) running on IIS 7. Dynamic content (everything that's being delivered by controllers) works fine, but static content such as CSS / Javascript / Images gives me a "200 OK" response, a Cont...

embeddable widgets using jquery and ASP.NET MVC

hello. I need some advice for the best approach to use in developing embeddable widgets that my site users could use to show our content on their site. Let's say we have some content which uses a jquery plugin to be rendered, and we want to give our customers an easy way to embed it in their websites. one option could be of using an I...

ASP.NET MVC 2 - Html.DropDownListFor confusion with ViewModel

I'm getting totally lost and confused on how to use the new strongly typed Html.DropDownListFor helper on ASP.NET MVC 2.0 R2 In the View I'm writting: <%= Html.DropDownListFor(m => m.ParentCategory, new SelectList(Model.Categories, "CategoryId", "Name", Model.ParentCategory), "[ None ]")%> <%= Html.ValidationMessageFor(m => m.ParentCa...

How to check if the key is an unsaved value in NHibernate

I am creating a model binder to use with asp.net mvc. This is what I got so far: public class ModelBinder : DefaultModelBinder { protected override object CreateModel(ControllerContext controllerContext, ModelBindingContext bindingContext, Type modelType) { PersistentClass mapping = DataAccess.Configuration.GetClassMappi...

Adding an Edit column to a telerik grid using ASP.Net MVC 2 and Telerik MVC (2010 Q1)

I have been successful with creating a Telerik grid to display a list of products, however I've gone through some difficulty adding the column to allow a user to edit (I'm not even trying to edit within the grid - I simply want a link to an edit view) When I add the custom column, I get the following lines in my error screen when I debu...

User log in with ASP.net

First time trying to deal with users logging in with ASP.net and haven't had much experience with it with other things. From searching, I am seeing things like Asp.Net MVC Membership Provider. Is this a built in thing? Is there any good online guides for this? ...

BDD with ASP.NET MVC

Hi there, I just started devoloping ASP.NET MVC Web applicatons. One thing I like about ASP.NET MVC is the built in test environment. It gives you the possibility to write unit tests and built test driven web applications (TDD). But I'm missing the possibility to do behaviour driven development (BDD). BDD can be done nicely using Ruby ...