My HomeController is controlling some pages like 'Index' and some others like 'Contact', 'About Us'.
But, if I type:
www.blabla.com/
the 'Index' will be called and it works.
But, if I type:
www.blabla.com/AboutUs
it doesn't work at all! It just works if I type:
www.blabla.com/Home/AboutUs
How can I make all the actions in Home...
Does role / view logic belong inside or outside of the Repository Pattern?
For example, I have a table of products, and each product has 5 price fields - one for each type of customer (wholesale, retail etc).
I only want to show the appropriate price to the appropriate user.
If I have a repository of these products, should the Product...
I'd like to get access to the current executing Controller so I can offload the return of the appropriate ActionResult onto a helper method. To this end, I'm looking for the equivalent of what I would have thought would be ControllerContext.Current but isn't. Thanks!
Edit for clarification: I've got a generic form control which is Jav...
Hi everyone!
How can I do this: I have on page named "Schedule" and it can be accessed through 2 differente ways:
URL 1- www.bla.com/Admin/Schedule
URL 2- www.bla.com/Schedule
"URL 1" will be accessed by users with Admin previlegies and this View will show some Admin stuff, and users must be LoggedOn.
In the otherhand, "URL 2" will ...
I would like to group all my Controllers with related Views in separate folders. How can I achieve this?
...
Alright this problem has been driving me a little crazy.
I have a checkbox on my form that looks like this:
<%=Html.CheckBox("Agreement", false)%>Yes, I agree to the terms
And then I have a js file that is loaded into the browser after jquery and jquery.validate are loaded that looks like this:
$.validator.setDefaults({
submitHandl...
I know I must be overlooking something. Here is my code, why is this not working:
<label>
Customer</label>
<%= Html.DropDownList("CustCodes", (SelectList)ViewData["CustCodes"], "-- Select a Customer --", null) %>
<script type="text/javascript">
$(document).ready(function() {
$("select#CustCodes").bind("ch...
How can I load a .resx file with GetLocalResourceObject when using NVelocity? I'm using ASP.NET MVC with mvccontrib nvelocity viewengine and sharp-architechture.
I've hardcoded every possible virtualpath I could think of (eg. ~/Home/index.vm.resx) but everyone fails. I've also tried with ExpressionBuilderContext.
...
As you may know we have got a new ActionResult called FileResult in RC1 version of ASP.NET MVC.
Using that, your action methods can return image to browser dynamically. Something like this:
public ActionResult DisplayPhoto(int id)
{
Photo photo = GetPhotoFromDatabase(id);
return File(photo.Content, photo.ContentType);
}
In the ...
Hi, I have the following problem:
For example I have route like this:
routes.Add(new Route("forums/thread/{threadOid}/last", new MvcRouteHandler())
Defaults = new RouteValueDictionary(
new { controller = "Thread", action ="ShowThreadLastPostPage"}),
Constrain...
Can a so called action in my controller just be a regular function that returns anything I want or does the return of an ActionResult declare whether its an "action" or not?
I was wondering if i could call functions in my ActionLink in the "actionname" that didn't return actionresults.
thx
...
I am looking to get on with contributors on an ASP.NET MVC Project. I am professionally developing for a large firm and don't get enough of it here. I also teach Java Object Oriented practices at a University, and still don't feel that I get enough of the engineering with this. Simply put, I am looking to get onto a project (small, op...
I'm trying to plan for future (months away) localization of a new ASP.NET MVC site.
Trying to decide what makes most sense to do, as far as constructing the URLs and routing.
For instance should I start off immediately with this :
http://www.example.com/en/Products/1001
http://www.example.com/es/Products/1001
or just
http://www....
I'm working on a sort of a CMS/Wiki application to help me experiment with the new Asp.Net MVC framework, and I'm trying to wrap my head around some of the code organization.
Right now, I have three views that cover displaying an article: Index, Edit, and Rename. All three views display the contents of the current page, or placeholder ...
I'm very new to ASP.net MVC, so please be as descriptive as possible in your answer :)
Let me simplify what I'm trying to do. Imagine I have a form where you want to enter some information about a car. The fields might be: Make, Model, Year, Image1, Image2.
On the bottom of the form is a "Save" button. The associated Controller meth...
So, I've read this and I've got a similar issue:
I have a shared hosting account (with GoDaddy, though that's not exactly relevant, I believe) and I've got an MVC (RC1) site deployed to a sub-folder which where I have another domain name mapped (or aliased). The sub-folder is also setup as an application root as well.
The site works w...
What is the best place (which folder, etc) to put view-specific javascript files in an ASP.NET MVC application?
To keep my project organized, I'd really love to be able to put them side-by-side with the view's .aspx files, but I haven't found a good way to reference them when doing that without exposing the ~/Views/Action/ folder stru...
I'm trying to write up a custom WebFormView to help with skinning a website I'm working on. The code is loosely based on how it's done in Oxite. The problem I'm having right now though is I'm not sure how I would unit test the Render method since it has a call to the BuildManager.
There are no unit tests for this code in the Oxite proje...
My asp.net-mvc view has an included javascript file.
This javascript file has the following line:
$("input[id='SearchBag.CompanyName']").autocomplete("Search.mvc/AutoComplete/");
This works. Great. But it would be even better if I could replace the autocomplete's path with a generated URL so if I change the routing paths, I won't have...
I haven't been able to replicate the exception when I browse my site... but I found out about this through my event logger (it emails my cell phone when an unhandled exception occurs).
Here's the exception:
The controller for path
'/Content/UsrImg/ImageFileName.jpg'
could not be found or it does not
implement IController.
Wh...