Hi,
I’m not sure if i’m doing this the right way so i’m reaching out for a little help...there are some new features in the trunk that I want to take advantage of in my current s#arp project.
I’ve downloaded the project from the trunk and run the go.bat file which succeeded, i then took the DLL files from the ‘build’ directory and over...
How do I access the current project directory in a unitest?
I would like to test a controller that accesses user generated files. In the controller, I use Server.MapPath("~/Uploaded") which works great. However, that doesn't work for the unittest.
I understand that I probably have to mock HttpContext.Server.MapPath but to what? Do I ...
I have a relatively simple ASP.net MVC 2 app that is using SubSonic. Everything seems to work well locally, but when I deployed it to WinHost, I keep getting an exception like so:
System.TypeAccessException: Attempt by method 'DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure, System.Data.Common.DbDataReader)' to access...
Hi Guys,
I am trying to figure out how to do a server ASP.NET MVC Image Load on Refresh. Basically, I have an array of image's I would like to rotate on refresh on the page. I know how to do this in jQuery but the problem is that all images load at the same time [which sucks in terms of performance]
Does anyone know how I could do this...
Does the ActionLinkForAreas link extension work with parameters + custom routes?
I have a route that exists matching my action which is:
routes.MapRoute("Profile", "profile/{artist}/{action}", new {controller="Profile", action="Index"});
But when I call ActionLinkForAreas like this:
<%= Html.ActionLinkForAreas<ProfileController>(x =...
I want to store extra information in the authenticated user so that I can have it easily accessible (like User.Identity.Id, for example), instead of just the name, since I'm planning on having that non-unique.
So far I've gathered that I should look to implement custom Principal and/or Identity, but I'm not sure how to go about it. I'v...
I'm building a web app that I'd like to:
Use the native UI capabilities of mobile devices (e.g. iPhone, Windows Mobile, Android phones) when rendered on those devices
Render nicely on non-web toolkit browsers (i.e. desktop browsers) such as IE, Firefox, Opera
My research so far has brought me to using the following technologies:
AS...
I have been told that it's more than likely my database that is setup wrong causing the problems so below are my tables with key fields and queries.
CREATE TABLE Presentations (
Id INT NOT NULL IDENTITY(1, 1),
SpeakerId INT NOT NULL,
CONSTRAINT PK_Presentations PRIMARY KEY (Id),
CONSTRAINT FK_Presentations_Speaker FOREI...
I'm building an Asp.net MVC 2 application.
I have an entity called Team that is mapped via public properties to two other entities called Gender and Grade.
public class Team
{
public virtual int Id { get; private set; }
public virtual string CoachesName { get; set; }
public virtual string PrimaryPhone { get; set; }
...
So I have a jquery autocomplete on a testbox that searches the database for a user, and places the ID in a hidden input field. For some reason the autocomplete fires when they type something, then again when an item is selected, changing the text. Since I'm searching first and last name it doesn't find any matches the second time and c...
In my ASP.NET MVC 2 application I use HandleErrorAttribute to display a custom error page in case of unhandled exceptions, and it works perfectly unless the exception happens in an action called by Ajax.ActionLink. In this case nothing happens. Is it possible to use HandleErrorAttribute to update the target element with the contents of a...
Hi,
I trying to return the same model back to the view that edited the model. Making it sort of like Word or something with ctrl+s functionality for saving the mode. This works fine though the model that is returned to the view contains a bunch of nulls for some stupid reason. Is it because things were not serialized properly when the c...
I'm trying to create my own templated helpers but I got stuck on TextBoxFor syntax. In C# its:
<%= Html.TextBoxFor(model => model) %>
And I cannot figure out (or google it) - how to write that in vb.net?
...
When I get the current url in a renderaction using
Request.Url.ToString()
It returns the url of the renderaction and not the page. Is there a way to get the current url of the page?
...
I have been looking around for a solution for my problem. Found alot of similar issues, but none of them led to a solution for me.
I am trying to register an Area within an Area. This works however it "partially" screws up my routing.
My route registrations in the order they are registered, consider the FooBar and Foo registrations to...
BIG EDIT: This problem is probably being caused by MEF!
I'm using a service oriented architecture and have all my MVC controllers perform actions through the services.
I have a base service that looks like this:
public abstract class BaseService
{
protected MyObjectModel context;
public BaseService()
{
co...
I have an inline style I want to apply to a partial view based on a parameter passed in to it via the ViewDataDictionary.
My ascx look like this -
<div <% if ((bool)ViewData["Visible"] == false) { %> style="display:none;" <% } %>>
...
</div>
Is there a cleaner way to do this?
Edit:
Just to clarify, this is a partial view which is...
I've used the PermanentRedirectResult from here to perform 301 redirects in ASP.NET MVC 1. Since upgrading to 2.0, the 301 response is no longer sent. Instead, a 200 response containing just the class name is sent.
Setting a breakpoint indicates that the ExecuteResult method on PermanentRedirectResult is never called. Apparently the fra...
Here is the example code:
public interface IService<TEntity> {
IContext Context { get; set; }
//unimportant methods
bool Validate(TEntity entity);
void Add(TEntity enttity);
}
public class UsersController : Controller {
private IService<User> _service;
public MyController(ISe...
I need to mask the input box/text box in ASP.NET MVC 2 for Credit Card. But the masking shouldn't affect its binding to its model.
I am trying to do something like this:
[DataType(DataType.MaskedCreditCard)]
similar to:
[DataType(DataType.Password)]
...