Hi,
I've seen articles and blog posts indicating what I am attempting to do should be supported; however, I have been unable to get it working so hopefully someone can confirm that it does/does not work and/or tell me what I am doing wrong.
I have a "complex" model (Invoice containing a List of InvoiceItem) that I am attempting to bind...
I'm currently working on a large scale ASP.NET MVC application and one area where testing is failing is around things that we're storing in session. My first pass at abstracting session is just to create a very simple static class and make all calls to session go through that. So I might have something like this:
public static class A...
I have a field in my model - call it 'distance' - and I want to write a view that contains both a checkbox and a textbox.
If the checkbox is checked, the textbox becomes disabled and 'distance' gets the value 0 when the form is submitted.
If the checkbox is not checked, 'distance' gets whatever value is in the textbox when the form is...
I'm trying to "Entitify" some external table (which I don't administer) in order to use it within a MVC application and in principle I'm not being terribly successful with the attempt (VS2008 output):
Error List [0 Errors] [0 Warnings] [1 Message]
Description
The table/view 'DATABASE.dbo.table' does not have a primary key defined and ...
I have the following jQuery
$('#btnDelete').click( function() {//Do the delete here via jquery post});
In my table I have numerous rows with the following
<a id="btnDelete">Delete</a>
How I do I pass parameters to the click event to post an ID to delete something
...
I've been working through the NerdDinner Tutorial and most of it makes sense. What I'm not sure about is why the Repository is used directly in the Controller and not the Model objects. For instance, if we wanted to implement our own membership system and it had an AccountController with a Login method, what would be the best solution fo...
I'm building an application using ASP.Net MVC, and I want/need it to work with and without javascript enabled. The first stumbling point for me is this: When the user clicks on the register link, if they don't have javascript enabled they should be sent to a registration page that has master page stuff around it... but if they do have ja...
Hi,
I have MVC 1.0 app on VS2008.
I have webpage that has a search form fields and then when search button clicked uses
Ajax.BeginForm to load results in a div. Works great!
But the results have a pager that just uses an anchor with href passing in page index to controller action.
Of course the same action that is used when the sea...
I am sorry this is perhaps a really stupid question. Forgive me because I come from a Java background and I am making an effort to learn .Net technologies.
I am trying to follow the tutorial for an ASP.Net MVC website from their website and I get to the part where I need to make a new model. When I right click they say I must choose ADO...
Hi I posted a question a little earlier and I had some replies that I should look at some different technologies. Which of the above (or other feel free to mention) is the most popular or best supported.
As stated in my earlier question I am learning ASP.Net MVC. I come from a Java struts background but I am prepared to try and learn wh...
Imagine a view that is designed to show a list of items of type Foo:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Foo>>" %>
Now the page displays the list of items of type Foo:
<table>
<tr>
<th>
Name
</th>
...
I have decided to use ASP.NET MVC for a website project and want to follow some of the best practices being written about.
So, I have separated out the Domain/Model into a separate project, created IRepositories and concrete repositories and have now turned my attention to Castle Windsor as the IoC.
The problem I now face is that for a...
Currently the way I am handling postbacks in ASP.NET MVC is to grab the input variables using:
string username = "";
if (null != Request["username"])
username = Request["username"].ToString();
I then would run a regex on the variable to ensure it was valid.
Is there any other method for doing this?
...
I am trying to access the Model data passed to the view in the action filter OnActionExecuted. Does anyone know if this is possible?
I am trying to do something like this:
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
//get model data
//...
sitemap.SetCurrentNode(model.Name);
}
Any advice?
...
In my ASP.NET MVC application, I would like my controller action to render a view to a string, send an email using that string as the body, then do a redirect.
I've found several articles here on SO and elsewhere on how to render the view to a string. That part was easy.
But when I attempt to perform the redirect, I get an HttpExceptio...
My controllers turn over the request to the appropriate service. The Service then makes calls to various Repositories. Repositories use Linq to Sql Entities purely for DataAccess and then map and return as Domain Objects. The service then decides what the Controller will present and replaces the DO with Presentation objects which are ret...
I define routes in my global.asax, like this:
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
Given a url:
/somecontroller/someaction/3
is it possible to determine which route this will map to, and get the corresponding route object, with name, url temp...
Hi,
I am trying to create a bootstrapper with a tasks (for now RegisterRoutes and RegisterControllerFactory) defined in a Spring.Net container. The bootstrapper code is below:
public static void Run()
{
IApplicationContext applicationContext = WebApplicationContext.GetRootContext();
IDictionary bootstrapperTasks ...
I am migrating a MonoRail application to ASP.NET MVC 1.0. In my original application I wrote a custom cache provider (a distributed cache provider using memcached). In MonoRail this task was very easy because the framework used interfaces and there is ICacheProvider that looks like this:
public interface ICacheProvider : IProvider, IMRS...
I've got an Entity Data Model with Product and Family types. Each Product has one Family.
I'm using this model with an ASP.NET MVC web site. I want Family DropDownLists on the Create and Edit Views of my Product controller.
How Do I Use Entity Object Navigation Properties in a DropDownList on my Strongly Typed ASP.NET MVC Create and ...