I have a list of controller names and their actions names. What I need to do is to read values from custom attributes on those actions.
The problem is that it seems there is no easy way to get controller types (Having that the rest is easy.)
ASP.NET MVC framework has this functionality in DefaultControllerFactory, but it's not accessible...
I added ASP.NET MVC manually to an existing WebForms application... thanks to
this tutorial.
However, now I do not have the menu options (When right-clicking on the Controllers folder or Views folders) to show the Add Controller or Add View dialog boxes. I do have this when creating a brand new MVC project. How can I get visual studi...
Here's what I'm trying to do in my Global.asax.vb:
Public Class MvcApplication
Inherits System.Web.HttpApplication
Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
routes.MapRoute( _
"Error", _
"error.html", _
New With...
When trying to add a few items to the database I'm getting this error:
UpdateException was unhandled by user code
An error occurred while updating the entries. See the InnerException for details.
The InnerException contains this:
{"Column count doesn't match value count at row 1"}
I can't see anything wrong with the objects...
I am reading the article:
Nine Options for Managing Persistent User State in Your ASP.NET Application
by Steven A. Smith (Doesn't he host a show on ESPN?)
In the article, Steven makes the following statement: "When dealing with a single ASP.NET page, ViewState is a better choice than QueryString for maintaining state"
Unfortunately, h...
How can I correctly handle exceptions thrown from controllers in ASP.NET MVC? The HandleError attribute seems to only process exceptions thrown by the MVC infrastructure and not exceptions thrown by my own code.
Using this web.config
<customErrors mode="On">
<error statusCode="401" redirect="/Errors/Http401" />
</customErrors>
...
I am using .NET MVC, and within view pages I set a contentplaceholder that contains an ID to be used on the master page like so:
View page:
<asp:Content ID="CDomBodyId" ContentPlaceHolderID="DomBodyId" runat="server">LmpDemoRequests</asp:Content>
Master page:
<body id='<asp:ContentPlaceHolder ID="DomBodyId" runat="server"></asp:Cont...
Important Update
Since the release of MVC 2.0 Preview 1 this feature has been implemented as the part of the actual framework itself in the form of Areas. More details available on Phil Haack's blog here
I have a controller called ListManagerController. This controller contain an ActionResult method called Index(). When I right ci...
Hi,
I had this problem before and can't for life of me remember how to fix it
or where I googled about it.
I am passing back from an action a partial view
return PartialView("CommentsListControl", recipe.Comments);
But this loads a new web page and not into my div WHY?????????
<table width="100%">
<tr><td>
<div...
or train, plane or couch.
Most programming books are quite thick and require you to sit at a computer while you read it.
Some of the thinner ones, like "Efficient C++" for example, are much better written and you can read them on the couch.
I am looking for books like that on recent ASP.NET technologies.
One example (though not reall...
I don't know whether people have already asked this question or
they haven't seen this problem or whatever.
I am Creating Strongly type view for each Create view.
I am validating the form at server side by making partial class of LINQ class Entities.
By adding Function Like
public IEnumerable<RuleViolation> GetRuleViolations()
{...
I am having trouble getting routing to work on mono. The default route works fine but nothing else does.
These are the routes I have setup:
routes.MapRoute(
"HelloRoute",
"Hello/{name}",
new { controller = "Home", action = "Hello" }
);
routes.MapRoute(
"Default",
...
Lets suppose that I have some pages
some.web/articles/details/5
some.web/users/info/bob
some.web/foo/bar/7
that can call a common utility controller like
locale/change/es
or
authorization/login
How do I get these methods (change, login) to redirect to the previous actions (details, info, bar) while passing the previous parameters...
Currently ASP.NET MVC's OutputCache attribute has a huge downfall. If you want to cache parts of your site you have to use a workaround due to the limitation of ASP.NET's pipeline that MVC relies on.
Say you have a page that has a statistics module that you surface through RenderAction you can't cache just that part of the page out of ...
I'm currently investigating the possibility to use custom attributes derived from ActionFilterAttribute. I want to accomplish a couple of things with a couple of attributes. The thing is I want to make sure one of the attributes comes into play first, and not in any random sequence.
Example:
public class Feature1Attrubute : ActionFilte...
In a View, code like this will generate the right URL to jump to controller's action method based on the routes in your global.asax.cs file.
<%= Html.ActionLink("text", "action", "controller") %>
My question is how can I achieve a similar route-to-URL mapping outside a view, such as a Controller? There is no Html member on the Cont...
Is there an easy way to implement OpenID login "helper buttons" similar to the buttons on the stackoverflow and uservoice login pages if you're already using a library like DotNetOpenId? It looks like RPX solves half of the problem, but it would require re-implementing the login code to use their methods.
...
In ASP.NET MVC controller methods can be decorated to accept on specific HTTP Methods(Get, Post, Get.. etc). Between MvcContrib and ASP.NET MVC there are 3 classes: "AcceptGet, AcceptPost" and AcceptVerbs. All three: "AcceptGet, AcceptPost" and AcceptVerbs do the same thing. They specify what http method is allowed to access a action/met...
Hi,
I am playing with ASP.NET MVC with visual webdeveloper express edtion 2008 and sql server express edition. I am creating a site that will use membership provider for that i want to use my own databse not the application services database. I have created my database in app_data folder but still I am not able to register it using aspn...
In all MVC Diagrams i've seen, there is always a connection between the View and the Model, indicating that the View has access to the Model.
I just wonder: When does this apply? At the moment, I have my Controller Action taking in a Parameter from the QueryString, query the Model in order to get MyObjectViewData, and then return a View...