Hi,
I am using the sharp architecture so I can easily use mocks etc. in my unit tests and/or during TDD. I have quite complicated business rules and would like to test them at the controller level. I am just wondering how other people do this?
For me validation tests business rules at three levels:
(1) Property level (e.g. property is...
I started off using the default project's AccountController, but I've extended/changed it beyond recognition. However, in common with the original I have a LogOn and LogOff action.
Clearly, the LogOn action must be accessible to everyone. However, since I've added lots of other actions to this controller (to create & edit users), I wan...
I want to render input for model field with prefix, like so: ..name="Field.FormId"...
How can I do this using typed helpers? When I use
Html.HiddenFor(m => m.FormId),
I get 'FormId' as field name..
...
I found this question which is a great starting point towards creating embedded widgets that enable showing dynamic content on remote sites (i.e. a different domain).
One problem I'm having is with the following code:
public ActionResult SomeAction()
{
return new JsonpResult
{
Data = new { Widget = "some partial html fo...
He,
I have this page where i have checkboxes next to every item in a table, and want to allow the user to select some of them and press my delete button. I just cant come up with the jquery for making the confirm window and submitting only if 'yes' is pushed - this is my page
<%Html.BeginForm(); %>
<%List<ShopLandCore.Model.SLGroup> ...
Hi all, I have the following code:
public ActionResult SomeAction()
{
return new JsonpResult
{
Data = new { Widget = "some partial html for the widget" }
};
}
I'd like to modify it so that I could have
public ActionResult SomeAction()
{
// will render HTML that I can pass to the JSONP result to return.
var...
If I have a table Orders with fields CustomerID, OrderID and OrderDate, then the "Linq-to-SQL classes" generated class will be called Orders, with members called CustomerID, OrderID and OrderDate. So far so good.
However, if I then do Html.LabelFor(m => m.OrderDate) then the generated text will be "OrderDate" instead of "Order Date".
I...
Our Client requires that we supply Widgits for their site. They want to link to us to get Html & the jQuery required to manipulate the Html and do asynchronous requests. I understand that there are cross-domain security limitations that would prevent this from being a possibility, but that some of those limitations are aleviated by using...
I followed instructions for mvc validation but I can't manage to solve this problem....
This is linq to sql model:
I set Entity namespace to be CMS.Model
If I try to declare partial class Article in Portal.Models namespace:
public partial class Article
{
....
}
Then, after using Article article somewhere in code I...
I am building an event system that posts data to a google calendar. I am using jquery 1.4.2, fullcalendar 1.4.5, and asp.net MVC 2. I am using a jquery ui modal dialog for the entry system. Jquery ui datepicker for the from and to fields. Select boxes for the time fields. I have tried both string and DateTime formats in the GCalEvent Cl...
Say I have:
public ViewResult List() {}
inside this function, I check if there is only one item in the list, if there is I'd like to redirect straight to the controller that handles the list item, otherwise I want to display the List View.
How do I do this? Simply adding a RedirectToAction doesn't work - the call is hit but VS just st...
Greetings!
I'm doing a Form on ASP.NET MVC 2, in my view I have a TextBox for the name, and two buttons.
One of the buttons is for submit, and the other one have a function in JS, that add's another textbox, and a drop down list.
In the post controller action method, how do I get all the parameters?
Here is the View Code:
<body>
<...
I have an application in asp.net MVC (C#), which has some basic user registration to maintain their contacts and also some other information of the users in various tables.
I need to implement Google gears to my asp.net mvc website using google gears' database API to make the website work offline and also faster.
Is there any good ref...
So let's say I have a view that access a date:
<%= Html.TextBoxFor(model => Model.Birthday) %>
How do I have my view dictate how that date is formatted? I'd like to use common formatting options, and it's important that this is 2-way (both for display and data-entry).
...
I have the following tag with a Html.TextBoxFor expression and I want the contents to be read only, is this possible?
<%= Html.TextBoxFor(m => Model.Events.Subscribed[i].Action)%>
...
I have an asp.net mvc 2 app. I need to display the same page to each user. But each user has different rights to the data. IE some can see but not edit some data, some cannot edit nor see the data. Ideally data that cannot be seen nor edited is whitespace on the view. For security reasons I want my viewmodels to be sparse as possible. ...
I want to outsource the design of my Asp.Net Mvc web application.
How can I make it easier for the designer to work on the site design and easier for me to plug it in to my master page and css file?
The Views will have elements like grids and other information display.
My application is still in the early stages of development. Should...
I've been programming in Asp.Net MVC for quite some time now and to expand a little bit beyond the .Net world I've recently began learning Python and Django. I am enjoying Django but one thing I am missing from Asp.Net MVC is the automatic routing from my urls to my controller actions.
In Asp.Net MVC I can build much of my application ...
I have a set of radio buttons that are dynamically generated (via JSON call):
StringBuilder sbEligAll = new StringBuilder();
sbEligAll.Append("<div id='currentselectiondepartment'>");
sbEligAll.Append(" <input type='radio' name='selectalldepartment' id='radCurrent' value='0' /><label for='radCurrent'>Current</label>");
sbEligAll.Appen...
Hi everyone,
We're going through an ASP.Net MVC book and are having trouble with using an extenstion method within our view. The Extension method looks like this:
using System;
using System.Runtime.CompilerServices;
using System.Web.Mvc;
namespace MvcBookApplication
{
public static class HtmlHelperExtensions
{
public static s...