How do controllers know which views to return? I thought it was by naming convention, but I have seen instances, for example in the Nerd Dinner application, where the names don't match. Where or how do I see this mapping? Thanks.
...
Hi,
ASP.NET MVC has a bunch of custom item templates to create controllers, views, etc. Those item templates appear to only show up in the Add New Item dialog box when you are inside an ASP.NET MVC project (or more specifically when the MVC project type guid is in the .csproj file). How do they manage to do this? I've looked through the...
I have one question regarding using JQuery UI tab control in the asp.net mvc view.
For example, I have three tabs, tab0, tab 1, and tab2 in one aspx page.
Tab1 lists all the products, and tab2 is a form to create a product. After I fill in all the data in tab2 and submit the form. How can I force the view to load tab2. By default, it's...
I have a User object on a Base controller, this is the standard type of User object you have with the .Net Membership Provider. I need this is decide if users have access to actions, views, and so on.
I am having a problem whereby I want to display user information on the Masterpage. Like a login view from WebForms. I tried to access t...
Hello,
I think I'm beginning to be confused with the job of a controller in MVC.
I have a service that exposes five functions:
list packages in queue
get package
delete package
accept package
deny package
My ASP.NET MVC controller depends on this service, and can generally execute a service call on an Action. I'm happy so far.
Th...
Due to how paths relate to VS resolving the path to a JS file and then how the actual path at runtime is resolved via the browser, I've currently got the following placed at the top of my Master Page within my application so that all my views have the appropriate JS intellisense and resolve correctly for execution:
<% if (false) { %>
...
What are all the available routing key words?
I've seen examples using resource, pathInfo, url, controller, action, etc, but I have no clue what is available for me to use.
I know if you just put an arbitrary word like "{blah}" in there, you are defining a parameter that will be used, but I'm guessing you won't be able to use "{resourc...
I have been studying, playing with and working with ASP.NET MVC since Preview 1 in 2007 (december). I have been a fan of it since 2008 and I support it all the way.
However I keep hearing and reading "ASP.NET MVC enforces a strict separation of concerns", including reading it in Professional ASP.NET MVC 1.0 by Rob Conery, Scott Hanselma...
Hi,
we have testserver for a ASP.NET MVC project. Everything works fine on dev machines, but we can't login if "Remember me" checked in on the login page (in this case the request is redirected to the login page, no exception occurs as far I know).
If we open a browser in RDP on the testserver, it's possible to use "Remember me" correc...
Hi
I been using VS2008 Pro for a long time now but since of licensing issues(Pro is under academic license) and the current project I am doing could be considered as commerial I decided to give VS2008 Express a go.
Now I made my project and a shell of all my pages. I went to add a class library to my solution so I can start adding my n...
I have a search box on a page (actually in a partial view though not sure that is relevant) with an Html.TextBox control.
<%= Html.TextBox("query", ViewData["query"], new { style = "width: 90%;" })%>
The action method takes "query" as a parameter, and I edit this value to clean up the string that is passed in:
public ActionResult S...
I cannot get the pager to work for my ListUsers page. The method in my controller looks like:
public ActionResult ListUsers(int? page, int? pageSize) {
int totalItems;
var members = Membership.GetAllUsers(page ?? 1, pageSize ?? 50, out totalItems);
ViewData["Users"] = ToList<MembershipUser>(members);
return View();
}
And my as...
Hi
This is a really strange issue. I have developed a small MVC application and have done testing up until now using the VS2008 built in dev server and everything works as I expect. I have now moved the solution to IIS hosted and I see different results in a view which uses an Ajax.ActionLink.
The actionlink links to a controller actio...
I am on the home page:
http://localhost/
http://localhost/Home (yeah, this one too, though I don't like it)
I have a foreach loop, looping through my categories. I want the Html.ActionLink to point to:
http://localhost/site/{category-name}
I currently have:
Html.ActionLink(cat.cat_name, "site", "", new { id = cat.cat_name}, null...
Hi,
I work on asp.net applications 'in-house' and would love to use asp.net mvc, but am not able to as our applications are deployed to web servers that are not in our control and currently only have .net framework v2 and IIS6. As well as there being no possibility of having time/money spent on converting current WebForms applications.....
I know that we should only create repositories for Aggregate Roots and not for the entities it aggregates. Should I apply the same logic to MVC, e.g., have a Controller/PageView for an Aggregate Root and then a/some PartialView/PartialAction for the sub-entities.
Please illustrate your answer with the famous Order/OrderLine example.
I ...
I'm trying to setup xVal with an ASP.NET MVC 2 Preview 1 project. I'm basically following the example at http://blog.codeville.net/2009/01/10/xval-a-validation-framework-for-aspnet-mvc/ to the letter (server-side only, so far).
I have annotated a BlogPost entity, and here is the Post action:
[HttpPost]
public ActionResult Index(BlogPo...
i have a link that calls into a javascript to give a confirmation:
$("a.delete").click(function() {
var name = $(this).parent().prev('td').prev('td').text();
jConfirm('Are you sure you want to delete the following member:' + name, 'Member Delete', function(r) {
});
});
i want, if the user clicks yes to call a controller ac...
I am interested to know what you guys feel should be deemed "correct behaviour" in terms of the UpdateModel method in ASP.NET MVC.
The reason I ask here is perhaps if this functionality is "by design" somebody could clarify as to why it is the way it is, and perhaps a way to call it differently to achieve desired functionality, which I ...
i have the following code in the asp.net mvc view
if (isLoggedInUserAdmin)
{%>
<%=Html.ActionLink("View", "Details", new {id = item.Mail_ID})%>,
<a href='/Users/ConfirmDelete?id= <%=item.Mail_ID%>' class="delete">Delete</a>
<%}
if (userRequiresApproval)
{%>
,<%= Html.ActionLink("Approve", "Approve", new { id = item.Mail_...