I'm trying to implement the GetHttpContext function from HtmlHelperTest.cs in VB.NET using Rhino Mocks, but I'm getting "Type 'HttpContextBase' is not defined." The compiler suggests changing it to HttpContext, but when I do that I get a run time error that a sealed class cannot be mocked.
My test project references System.Web and also ...
For some specific reasons, I need to use the jQuery 'load()' method in order to feed a webpage into a div layer.
Most of these webpages are plain .html files.
However for some, there is some data processing going on - I would like to be able to leverage the ASP.NET MVC model (which the site is built in) - but that's not possible with ...
I have a custom model binding:
using System.Web.Mvc;
using MyProject.Model;
namespace MyProject.ModelBinders
{
public class VersionedIdModelBinder : IModelBinder
{
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
//Not completely happy with this. Wha...
Hi
I have a validation class that implements IDataErrorInfo that has all the methods that you must implement.
One is
public string this[string columnName]
{
get
{
}
}
return "";
Now in this switch statement I have some validation for my form.
Now I noticed lots of my for...
First of all, let me state I'm very new to EF. With that said, here's my dilemma:
There will be an ASP.NET App migrated to ASP.NET MVC. I would like to utilize EF for this. There is one main database which stores "client information". Apart from that, every "client" has their own database. These are the constraints we have.
Currently, ...
I have an action i call from a anchor thusly, Site/Controller/Action/ID where id = an int.
later on I need to redirect to this same Action from a Controller.
Is there a clever way to do this? Currently I'm stashing ID in tempdata, but when you
hit f5 to refresh the page again after going back, the tempdata is gone and the page crashes...
MVC practically begs to create pages that are organized into clear areas of responsibility. So instead of a single page with two or three editable grids that allow in-line changes to their lists, in MVC one is more likely to get a specific edit page per line item per grid.
For that matter one is very unlikely to see the type of page th...
Are there any changes I can make to Visual Studio to add the "Add View" dialog option to a folder other than Views? I have my website split up somewhat differently and I'd still like access to the T4 templates provided by "Add View".
To clarify:
I am not trying to change the default View Engine or do anything in code pertaining to how ...
I am still mostly unfamiliar with Inversion of Control (although I am learning about it now) so if that is the solution to my question, just let me know and I'll get back to learning about it.
I have a pair of controllers which need to a Session variable, naturally nothing too special has happen because of how Session works in the first...
Hi
I just got this book
In it there is a .dll for a generic repository. I followed what he did but I always get a error.
System.InvalidOperationException was caught
Message="The EntitySet name 'MyEntities.CarSet' could not be found."
Source="System.Data.Entity"
StackTrace:
at System.Data.Objects.ObjectContext.GetEntitySet...
Hello
I have a model that looks like this:
public class UserAdminEditViewModel
{
public User User { get; set; }
public IEnumerable<Usergroup> Usergroups { get; set; }
public IList<int> UsergroupID { get; set; }
public UserAdminEditViewModel() {}
}
And my View looks like this:
<%@ Page Title="" Language="C#" MasterPa...
A number of questions have been asked on this topic before, but since ASP.NET MVC is moving quite fast I wanted to re-ask the question:
What would you recommend for providing form input validation in ASP.NET MVC?
Requirements:
Server-side checking
Client-side (JavaScript) checking
Should cover the basics such as mandatory fields, num...
Hello
I have a model that looks like this:
public class UserAdminEditViewModel
{
public User User { get; set; }
public IEnumerable<Usergroup> Usergroups { get; set; }
public IList<int> UsergroupID { get; set; }
public IEnumerable<User> Users { get; set; }
public UserAdminEditViewModel() {}
}
And in my post-action...
Hi,
I have an ASP.NET MVC application that uses LINQ2SQL as the database layer. I can save data back to the database no problem but I've came across a few issues when trying to save using a wizard-type scenario where data is collected over a few different forms but not saved to the database until the last form "Save" button is clicked....
I'm trying to create an Html Helper, by creating a static class as follows:
public static string Crumbs(this HtmlHelper helper, params string[] args) where T : class
{
// ... rest of code goes here.
}
And I'm invoking it like this:
<% Html.Crumbs(
Html.ActionLink("Home", "Index", "Home"),
Html.ActionLink("Lists", "Index",...
The question is in the title.
...
I have model classes in Linq-to-Sql with partial classes marked with data annotation attributes and a reference to xVal.
When I bind a view directly to a model everything works great, both the JS generated by xVal and server side double check.
Many of my views don't take input to one specific model, so I am setting up view model cl...
I have a prototype ASP.NET-MVC website which uses Ninject as a IoC container. All service-classes and repository-classes used by MVC Controllers are properly injected by Ninject. This is great.
The next thing I need to add there is Silverlight (version 3 to be more precise).
Silverlight will be connecting to my server using WCF service,...
We are beginning the process of moving from Web Forms to MVC for all of our new applications. I am working on porting our Master Page over and am trying to satisfy the requirements that we need a single master page to be used by all applications. The primary navigation for the application needs to be in a menu within the master page. Ac...
I am having a problem with Jquery Tabs. On my MVC page, I have a form that returns a partial page (.ascx). This page has Jquery tabs on it, howerver all I get is the tab content without the tab. It looks like the partial page javascript code for the tab does not run,
<script type="text/javascript">
$(function() { $("#tabs").tabs(); ...