I've just created my first Preview 5 error and it doesn't seem to place nice with Resharper. All the C# in the Views are coming up with errors, things like <%= Html.Password("currentPassword") %> has the "currentPassword" highlighted with the following error: Argument type "System.String" is not assignable parameter type "string".
IL...
I'm debating whether to use Silverlight 2.0 vs ASP.NET MVC for a web application. The web application will be a subscription free service marketing all age groups. It's important the source is highly testable, but also with the Web 2.0 movement a graphical web application is important as well for competitive reasons.
I'm assuming silv...
What are some of the advantages of using one over the other?
...
I have an MVC-based site, which is using a Repository/Service pattern for data access.
The Services are written to be using in a majority of applications (console, winform, and web). Currently, the controllers communicate directly to the services. This has limited the ability to apply proper caching.
I see my options as the following...
Moved from preview 2 to preview 5 and now my Html.ActionLink calls are all failing. It appears that the generic version has been replaced with a non-type safe version.
// used to work
<li>
<%= Html.ActionLink<HomeController>(c => c.Index(), "Home")%>
</li>
// what appears I can only do now
<li>
<%= Html.ActionLink<HomeController>("...
What is the purpose of the code behind view file in ASP.NET MVC besides setting of the generic parameter of ViewPage ?
...
How can I Handler 404 erros without framewok throw Execption 500 error code
...
I have an ASP.NET MVC-application which I want deployable on both IIS6 and IIS7 and as we all know, IIS6 needs the ".mvc"-naming in the URL.
Will this code work to make sure it works on all IIS-versions? Without having to make special adjustments in code, global.asax or config-files for the different IIS-versions.
bool usingIntegratedP...
How do I change the style (color) of a div such as the following?
"<div id=foo class="ed" style="display: <%= ((foo.isTrue) ? string.Empty : "none") %>">
<%= ((foo.isTrue) ? foo.Name: "false foo") %>"`
...
aspnet mvc has the HandleError filter that will return a view if an error occurs, but if an error occurs when calling a JsonResult Action how can I return a JSON object that represents an error?
I don't want to wrap the code in each action method that returns a JsonResult in a try/catch to accomplish it, I'd rather do it by adding a 'Ha...
I am looking to set the result action from a failed IAuthorizationFilter. However I am unsure how to create an ActionResult from inside the Filter. The controller doesn't seem to be accible from inside the filter so my usual View("SomeView") isn't working. Is there a way to get the controler or else another way of creating an actionre...
I have some code in an IAuthorizationFilter which redirects the user to a login page but I'm having trouble changing the controller which is used. So I might do
public void OnAuthorization(AuthorizationContext context)
{
UserController u = new UserController();
context.Result = u.Login();
context.Cancel = true;
}
But this resu...
We've just updated ASP.NET from Preview 3 to Preview 5 and we've run into a problem with the Html.Image HtmlHelper in our aspx pages.
It seems that Html.Image has moved from System.Web.Mvc into Microsoft.Web.Mvc, and the only way we've found to access the helper now is to add an import statement to every .aspx page that uses it. All the...
I was reading a post by Brad Wilson (http://bradwilson.typepad.com/blog/2008/08/partial-renderi.html) on the new ViewEngine changes to MVC Preview 5 and thought that it would be great to be able to render a view to string for use in tests. I get the impression from the article that it may be possible to achieve this but cannot figure out...
The following code is in the /Courses/Detail action:
[AcceptVerbs("GET")]
public ActionResult Detail(int id)
{
ViewData["Title"] = "A View Title";
return View(tmdc.GetCourseById(id));
}
The tmdc.GetCourseById(id) method returns an instance of type "Course" for the View. In the View I am using <%= HTML....
I really like the fact that Microsoft has taken a commitment to bring MVC to the Web. To this end, I have become excited about converting one of my existing ASP.NET apps to MVC and wanted to know if I may be jumping the gun. While this site is using MVC, it's still technically in beta...what are your thoughts?
...
I am starting a new ASP.NET MVC project to learn with, and am wondering what's the optimal way to set up the project(s) to connect to a SQL server for the data. For example lets pretend we have a Product table and a product object I want to use to populate data in my view.
I know somewhere in here I should have an interface that gets i...
Has anybody established a good naming convention for action in MVC? I was specifically looking at ASP.net MVC but it is a general question. For instance I have an action which displays the login screen (Login) and one which process the login request from that page (LoginTest). I'm not keen on the names and I have a lot of the applicai...
I would like to be able to render a view and send it as an email, similar to what can be done with Ruby on Rails. What is the best way to do this?
EDIT: My solution so far is to use a templating engine (NHaml, StringTemplate.net). It works but I would prefer not to have a second template engine in my site.
...
Up until now I've been able to get away with using the default routing that came with ASP.NET MVC. Unfortunately, now that I'm branching out into more complex routes, I'm struggling to wrap my head around how to get this to work.
A simple example I'm trying to get is to have the path /User/{UserID}/Items to map to the User controller's...