Hi, in tutorial Validating with a service layer constructor for Product Service looks like this:
ProductService(IValidationDictionary validationDictionary, IProductRepository repository)
and its instance in default controller constructor is created like this:
public ProductController()
{
_service = new ProductService(new Mode...
I just finished Scott Gu's Nerd Diner tutorial. I found it very helpful because it not only taught the basics of ASP.Net MVC, but also how to use with Repositories, Validation, Unit testing, Ajax, etc.. Very thourough, but still manageable.
However, I am curious about his site structure:
Specifically, he used this view strucuture for ...
I'm looking for a method of storing routing information in my web.config file in addition to the Global.asax class. The routes stored in the configuration file would need to take higher precedence than those added programmatically.
I've done my searching, but the closest I can come up with is the RouteBuilder on Codeplex (http://www.cod...
How do I get the path of a controller? For example, I can get the path of a HtmlHelper like this:
private static string GetVirtualPath(HtmlHelper htmlhelper)
{
string virtualPath = null;
TemplateControl tc = htmlhelper.ViewDataContainer as TemplateControl;
if (tc != null)
{
virtualPath = tc.AppRelativeVirtualPath;
}
...
How do I mock a page request for a .net MVC page?
...
I've been using asp.net mvc and I like the facility given by UpdateModel & TryUpdateModel. Now I'm developing an application using the Web Client Software Factory. Are there any model binders I can use with this?
...
If I want the default url of my web app to display completely different UIs depending on the user, what is the best way to accomplish this? I don't really want to use the same controller for every type of user. To put it another way, if a user is logged in and goes to http://mysweetapp.com and is an admin user, they should get what they ...
So, my question is, can any of the ASP.NET Ajax controls from the Control Toolkit be used without their server-side controls and without an ASP.NET Ajax ScriptManager.
For reference, I am asking in the context of an ASP.NET MVC application.
Clearly, some of the controls don't make sense in this model because they do postbacks to the s...
<% foreach (FoodMenu f in (IEnumerable)ViewData.Model)
{
%>
<ul >
<li><%= Html.Encode(f.ProductId) %> </li>
<li><%= Html.Encode(f.Name) %></li>
<li><%= Html.Encode(f.Price) %> </li>
<li><%= Html.CheckBox("Selected") %></p></li>
</ul>
</div>
...
I was asked to review a system the other day that was based on ASP.NET MVC + CSLA + DDD (domain drive design). The first version of this system was based on ASP.NET MVC + CSLA. The second release was based on that plus added DDD. The reason is because..... well, I don't know what. As I looked at the diagrams from the two different ar...
In asp.net mvc, I have been thinking it would be more advantageous to specify parametrized constructors on the view classes in contrast to using ViewData to pass data to the view. In this way the view class could be instantiated in the action and returned from there as an implementation of IView for eventual rendering to the client by th...
Hi,
Vista, VS2008, MVC 1.0.
I have a MVC app using FluentNHibernate to do the configruation.
I have published the app to IIS7 on local machine.
When I browse the app I get error
'C:\Users\Malcolm\Documents\Temp\MyProject.Domain.Ingredient.hbm.xml' is denied
First thing is I am using FluentNhibernate so why is it using xml files for...
Before I get pointed to one of those 'VS.' questions like below...
ASP.NET webforms + ASP.NET Ajax versus ASP.NET MVC and Ajax framework freedom
Should I pursue ASP.NET WebForms or ASP.NET MVC
ASP.NET MVC Web application vs ASP.NET Web Application
... please let me state that I'm not looking for a comparison.
Some of my concerns tha...
I am using Windows Authentication in my ASP.NET MVC application and I am prompted to enter credentials on my webserver which is a domain member [I have domain credentials and can authenticate fine] however when my controller action calls "User.Identity.Name" in an attempt to check a database value against the currently logged in user thi...
I've got a simple structure
Widget (parent table)
id (IDENTITY)
title
WidgetChild (child table)
-
id (foreign key to widget.id)
content
On my View i have one field that captures the title, and another field that captures the content value.
<%= Html.TextBox("title") %>
and
<%= Html.TextBox("content") %>
How do i go abo...
Does anybody know why could some HTML form controls be rendered using System.Web.Mvc.HtmlHelper (hidden, checkbox, password, textbox) and some couldn't and should be explicitly written in HTML (file, submit)? What is the principle of this separation?
...
I've asked a few questions on this topic before. Before we're able to implement either MVC or LINQ at work we need to resolve a few issues.
Multiple Record Sets in ASP.NET MVC
The only examples of MVC in use only have a single result set returned. When using stored procedures multiple record sets can be retrieved, and the whole reaso...
You can see what GET Delete action method passes DDW2File object to view. Is it possible somehow to bind this object back to ddw2file parameter of POST Delete action method? Now I have null value in it.
Code fragment:
public class DDW2FileController : Controller
{
...
public ActionResult Delete(string fileName)
{
r...
I am trying to navigate between controllers using ActionLink.
I will tell my problem with an example.
I am on Index view of Hat controller
I am trying to use below code to create a link to Details action of Product controller.
<%= Html.ActionLink("Details", "Details", "Product", new { id=item.ID }) %>
Instead of creating me a link...
Guys,
I am testing Azure and I keep running into this problem - I have no idea if anyone else has experienced something similar. Locally, the solution is working fine - no problems at all, but when I put it into the cloud - I just keep getting this error ?
Any Ideas?
Azure Configuration Error type="Microsoft.Samples.ServiceHosting.Asp...