asp.net-mvc

Good or bad practice, using regular html in view

Being comfortable with using html, I find it easier to just use regular html in my views, for example, creating a textbox with <input type="text" maxlength="30" name="firstname"> instead of <%= html.textbox("firstname") %>. Or <form method="post" name="myform"> instead of <% html.beginform() { %>. Is this considered bad practise ? Shoul...

How to get a 'codebehind' file for an ASP.NET-MVC View in RC1 to be created by default

In RC1 the behavior of the template for creating a view changed. As explained by Scott Gu's post about the release candidate a newly created aspx view doesn't have a code-behind file by default anymore. Based on feedback we’ve changed view-templates to not have a code-behind file by default. This change helps reinforce the pu...

Using jTemplate with ASP.NET MVC

In this article, Dave Ward describes how to use the jQuery plugin jTemplate to create what he calls a "client side repeater", that parses JSON data into a template on the client side. Toward the end of the article, he suggests that the template is placed in a separate file with the extension ".tpl", and that the data is loaded into the ...

How should I integrate session state into an ASP.NET MVC application?

I'm looking for thoughts on how should I use Session in an ASP.NET MVC application? Especially when using masterpages and tryin to just get the data to the masterpage without bypassing the controller. This question started off by me asking a lot of little questions, but then I managed to mould it into a solution which as yet I have not i...

Problems using NHaml with ASP.NET MVC RC

I had no problems using NHaml with ASP.NET MVC Beta, but when upgrading to ASP.NET MVC RC I am getting a suspicious error Method 'FindPartialView' in type 'MvcContrib.NHamlViewEngine.NHamlViewFactory' from assembly 'MvcContrib.NHamlViewEngine, Version=0.0.1.175, Culture=neutral, PublicKeyToken=null' does not have an implementation. ...

How To Save Navigation Properties in the Entity Framework

I'm trying to use the repository pattern to save an entity using the Entity Framework. I'm unclear on how to save the Navigation Properties (like Account below). Can anyone shed some light on this. Especially how one would set the AccountId from an MVC controller all the way through to the repository where it's saved. Thanks! --- Sa...

Can have part of the domain name as a parameter in my routing rules?

I'd like to have a routing rule that accepted part of my domain name as a parameter. For example: {name}.mydomain.com/photos/{id} Is this even possible? ...

asp.net mvc blogging engine

I am looking for some open source blogging engine build on ASP.NET MVC. Is there any production ready projects available? Note from svinto: I want this as well, but rather something that plugs in to any asp.net mvc site, using any DI/IoC or ORM. - Instead of creating a new similar question, I'm using this one. These are the blogging e...

ASP.Net MVC Authorisation action filter question

Hi, I'm trying to understand how error handling works when using the Authorize [Authorize] Action Filter in MVC Preview 4. I have an action that looks like this: [Authorize(Roles = "DOMAIN\\NOTAUTHORISED_ROLE" )] [HandleError] public ActionResult NeedAuthorisation() { throw new NotImplementedException(); } ...

Implementing filters for a SQL table display on a view in ASP.NET MVC (C#) and LINQ-to-SQL?

A follow-up from this question, I've changed my controller and routing around so that now the sort value is assigned by ?sort= however I also want to implement the ability for users to filter the table based on a select set of values: Technician : Tech1, Tech2, Tech3, etc. Category : Category1, Category2, Category3, etc. Priority : Prio...

ASP.Net MVC Routing issue

I've got an issue with MVC routing(or at least I think it's w/routing :) )... Just upgraded to MVC RC1, but I'm not sure that it's related as this is my first attempt at setting a MapRoute and corresponding RouteLink. here's the route: routes.MapRoute("Test1", "Forecast/CurrentLineItems/{propertyID}/{forecastYear}/{for...

asp.net mvc framwork information propagation

I have an asp page containing a form with two fields where the client is supposed to write his/her information. <td><%=Html.TextBox("Date")%></td> <td><%=Html.TextBox("City")%></td> My action's signature looks (at the moment) like this: public ActionResult XXX(string Date, string City) {...} The problem is that I want to propagate...

ASP.NET MVC and httpRuntime executionTimeout

I would like to increase the httpruntime executionTimeout for a subsection of an ASP.NET MVC application. In a regular Web App, you could use <configuration> <location path="UploadPage.aspx"> <httpRuntime executionTimeout="600"/> </location> </configuration> however there really is not the idea of "Folders" in ASP.NET MVC, so how wo...

Am I allowed to host an ASP.NET MVC website using Mono and mod_mono?

I heard somewhere that the MVC license prevents you from using it on non-microsoft technologies, which would prevent me from developing in mono and hosting in Linux. Is this true? Has anyone used it with mono? Can anyone point me in the direction of the license? ...

Problem with ASP.NET MVC routing

Hi everyone!! I have a page that I want it to have 2 different routes: "/Admin/Schedules" AND "/Schedules" "/Admin/Schedules" if for admin users and the page will render some admin features and it needs to log in... on the other hand, "/Schedules" is for non-logged users and it will render non-admin features... But, the page is t...

Problem using Add View dialog in ASP.NET MVC RC1 for strongly typed view

I like the new Add View dialog that was released with RC1. If you specify a view data class, it generates a scaffolded view for you. It seems to work fine with classes defined in projects within my solution. Some of my domain classes inherit from a base class that is defined in an external assembly (and referenced in my web project). ...

LINQ, Large filter on a query

I am building a section of an application that revolves around pulling information about transactions out of the database. Due to the nature of the data, there are many columns in the table that I want to filter on. I have a filter selection box with 15 fields that I want to be able to build up a where clause for the LINQ statement. T...

jQuery vs MicrosoftAjax in ASP.NET MVC

Under what circumstances would you use MicrosoftAjax over jQuery in an ASP.NET MVC application? According to Scott Cate in this podcast Object Oriented AJAX with Scott Cate MicrosoftAjax is good for sending and retrieving data to and from the server. And jQuery is good for manipulating your data via the DOM once it arrives at the client...

The view 'Whatever' or its master could not be found.

All of a sudden in this MVC site I have no views that can be found. The view 'LoginUltraMind' or its master could not be found. The following locations were searched: ~/Views/MyAccount/LoginUltraMind.aspx ~/Views/MyAccount/LoginUltraMind.ascx ~/Views/Shared/LoginUltraMind.aspx ~/Views/Shared/LoginUltraMind.ascx ~/Views/MyAccount/storeNo...

Looking for a .NET library to do authentication that support multiple sources.

I'm looking for a suggestion for a .NET library which can allow me to use in an ASP.NET application so that I have one profile for each user, but can associate authentication from multiple sources including: ASP.NET Forms based, windows live id, google, facebook, openid, etc... I want people to come to my website and be able to associate...