Now i'm trying to do registration/authorization by my own (ASP.NET MVC). I've already implemented RoleProvider class and ValidateUser from MembershipProvider class. Now i'm trying to implement CreateUser, but i don't want to use original parameters, because i got my own. It's possible somehow to not use original parameters or create my o...
The model being passed to my view is of type tblUser - so I expected that I would be able to:
<% Model.tblLogins.Where(l => l.date > DateTime.Now.AddDays(-7)).Count() %>
However, the .Where() part is not available as an option? I have the following in my web.config but hasnt helped:
<add namespace="System.Linq"/>
<add namespa...
In the "Admin" area of my application, an object must be available in ViewData on every page (for display in the Master template). I have already inherited from Controller, so I cannot make a simple base class that handles it. What is a good solution of doing this when not using inheritance? An ActionFilter seems interesting but I don't ...
Based on my co-worker's code, he is passing HTML attributes into his form declaration in the view using BeginForm and the resulting HTML looks like:
<form action="/Reviewer/Complete" ipbID="16743" method="post">
How can I obtain the ipbID in my Controller code? I've trying
HttpContext.Request.QueryString["ipbID"]
... and ...
Req...
I have two projects (Project A and Project B), these projects are hosted in different locations and on different servers. Project B want to access the files of Project A. Can any one suggest me which technique is required to fulfill my requirements.
...
I would like to get opinion on the best way to manage the following please. I have an MVC application project, as well as a DomainModel project. The NHibernate mappings and hibernate.cfg.xml are in the DomainModel project which is referenced in the MVC application. This would normally work fine as all my dataaccess would go through the N...
I'm using ASP.NET MVC 2 & VS 2008 Pro.
I am building a web site where users must go from page A to page B to page C. In other words, the order is very important. I want to guard against a user on page A simply entering a url for page C. If the user attempted to do such a thing I'd like to redirect them back to the page they were on befo...
I need to setup a file handler to route with multiple sub directories something like tihs;
http://localhost/images/7/99/786936215595.jpg
I tried putting this in the global.asax file;
routes.Add(
"ImageRoute",
new Route("covers/{filepath}/{filename}",
new ImageRouteHandler()));
I am using the ImageHandler found in this Que...
Hi. I'm want to do a class with file extensions, I thought the extensions should be strings.
My problem is I'm not sure how to do this class? I want it to be kinda static so I don't have to declare it like new. I would appreciate any help I can get on this, it's often I find myself in situations where I would need a class like this.
EDI...
I'm trying to use the AutoMoqCustomization with AutoFixture to create an ASP.NET MVC2 Controller in a unit test via the Fixture.CreateAnonymous method. I've tried in both xUnit under TestDriven.NET, the xUnit test GUI and in MSTest and all have the same result: a massive failure of the process running the test. On Windows 7 x64 if that...
What is the common practice in mvc2 regarding url fragments?
When the page is ajaxed, how to save the state in url so it can be bookmarked easily?
...
if i have the following
Url.Action("Index", "Settings");
How do ensure that the url is alway
"Settings/Index" and not "Settings"
...
I want to render an *.aspx instead of an *.ascx
namespace GenericMVCPlatform.Generics
{
public class PlatformView : IView
{
public void Render(ViewContext viewContext, System.IO.TextWriter writer)
{
// Here I would like to render an *.aspx instead of a *.ascx
}
private static MvcHtml...
Is there a sample implementation for System.Web.Mvc.IView.Render() that I could use as a template?
...
I need to implement a page with both search form with a search button and grid that displays results ( sortable and pagable ). Lets call this page the summary page.
Whole page needs to be ajaxified so it won't reload itself when user is searching or paging or sorting the results.
I've got two questions :
1) what is the best way to sav...
Hi
I have page with a simple table and advanced search form. I pass List<Customers> to the model:
View(List<Customers>);
So what is best way to pass and return data to the search form? I want to use validation or something but I think passing data through ViewData is not good idea. Any suggestions?
...
I followed the http://haacked.com/archive/2010/04/15/sending-json-to-an-asp-net-mvc-action-method-argument.aspx blog on how to setup binding json data to a ViewModel. seems to work.
The problem is that it is super slow. A collection with 200 entries in it and 8 fields per entry takes 3 minutes to even reach a break point at the beginni...
I don't think this should be in my view, but instead handled by the controller. I suppose this could be done in the SQL (can get ugly real quick) or in the controller (I think this might be best), or maybe even an HTML helper. But, I'm not sure how to unpack/repack my IQueryable/IEnumberable in the controller. I think that giving the tem...
I have a link in my action like this
<%: Html.ActionLink("View Data","Index","MyItem", new {itemId=Model.itemId}, null)%>
now in my newItem controller in its index action how do I retrieve this itemId, so far I have tried
this
public ActionResult Index()
{
RouteData rd = this.RouteData;
var list = from...
I am writing a VirtualPathProvider to dynamically load my MVC views, which are located in a different directory. I successfully intercept the call before MVC (in FileExists), but in my VirtualPathProvider, I get the raw, pre-routed url like:
~/Apps/Administration/Account/LogOn
Personally, I know that MVC will look for
~/Apps/Adminis...