asp.net-mvc

Specifying partial view path using T4MVC

Hi all, I am using T4MVC in our ASP.NET MVC Project. I have a statement like this in my view <% Html.RenderPartial(MVC.SomeController.Views.PartialViewName); %> Which was previously like this <% Html.RenderPartial("../SomeController/PartialViewName"); %> Previously it was working fine, but after I specified the partial view using...

ASP.NET MVC app custom error pages not displaying in shared hosting environment

I'm having an issue with custom errors on an ASP.NET MVC app I've deployed on Go Daddy. I've created an ErrorController and added the following code to Global.asax to catch unhandled exceptions, log them, and then transfer control to the ErrorController to display custom errors. This code is taken from here: protected void Applicati...

What is best book for ASP.NET MVC?

What is the best book for ASP.Net MVC anyone suggest best resources to learn ASP.Net MVC ...

Calling controller from view ?

Controller1 - Index() > return View1 Controller2 - Index() > return View2 Controller3 - Index() > return View3 .... Controller1000 - Index()> return View1000 ControllerAAAA - GiveMeSomething(....) > return PartialView1 Objective: Add the result of PartialView1 on the View 1 to 1000. Solutions: The controllers 1 to 1000 could inheri...

Asp MVC, is session lost upon building solution?

Hello, all. I 'm writting an application in ASP.NET MVC. Basically I have some pages which require user authentication. Upon user logon, I keep the user row in a session. So in my controller I can access to the user.ID without making extra queries. When project is in debug mode I can only change things in the views. Not in the controll...

ASP.NET: Strategy for handling really large reports...

Maybe not specific to reports but still... In my asp.net mvc web application there's a section for reports that show 5 columns of data that map almost directly to a table in the db. The problem is, in some cases, the length of that report may exceed 40,000 records (I know, nobody can really process 40,000 records of data but the report...

subsonic 3.0.0.3 activeRecord Between

Hi im using subsonic 3.0.0.3 activeRecord but cant seems to figure between ! select * from orders where orderdate between startdate, enddate; have tried IQueryable<orders> myOrders = order.All().Where(x => x.order_date).isBetweenAnd help much appreciated, please make note of version number, and that any answers actually work for that...

asp.net mvc update webpage from server

What I'm trying to do is force a webpage to update with new content without refreshing when it is set on the server. Ideally a user would be looking at a blank page that would update with specific content when it is set on the server or in the database. Any ideas on how I could go about doing that? ...

ASP.NET MVC Routing to serve a file at website 'top level'?

I'm an absolute beginner with ASP.NET[MVC] so this is probably a dumb question. I want to wire-up a url "http://localhost/clientaccesspolicy.xml" to a specific controller action. How could I go about doing this? I'm also wondering how to just statically serve a file for this url. (I was able to statically serve the file by adding it a...

Linq return bool where a = val1 & b = val2 from model?

Hello I have 2 for loops and need to check if the model contains value based on current ones. <% for (int currentDay = 1; currentDay <= 7; currentDay++) { %> <%=Html.CheckBox("TimeRange" + currentDay.ToString())%> <%} %> Somehow I need to make the checkbox checked if the model contains data based on 2 parameters (...

using custom Profile provider in ASP.net MVC?

Hello, im currently trying to implement a profile provider for my site a few days now and having a hard time working on it, im a php programer and i just shift to asp.net recently Im using Linq to sql and follow this http://www.codeproject.com/KB/aspnet/LINQCustomProfileProvider.aspx tutorial. the reason im using my own because i havin...

Batch Size in web config for Nhibernate in ASP.NET MVC

How do I set the batch size for Nhibernate? I'd like to do this in the web.config. The examples I see, don't make a lot of sense to me. In this example they are using code to set the batch size. I don't wnat to do that. I want it configurable in the web.config. I understand how to add the config section, I just have read articles t...

ASP.Net MVC 2 Default.aspx

I just installed the ASP.Net MVC Preview 2 so I can have a look at some of the new features. However when I create a new MVC 2 project it creates everything but default.aspx, is this a bug or is this handled differently in version 2 to version 1? When I run the project it just takes me to the directory listing, I assume I could just cop...

Choosing an ORM for a "simple" SaaS startup (ASP.NET MVC)

I'm about to start developing a web-based application that I can best describe as a specialized version of 37Signal's Highrise contact management app, targeted towards service businesses such as lawn care. I've decided to use ASP.NET MVC to take advantage of my BizSpark membership and to leverage the C#/ASP.NET/SQL Server that I already...

What's the best way to inject different implementations of the same interface in to a controller using StructureMap?

I am fairly new to StructureMap, but my understanding is that there are two ways of getting an instance from the ObjectFactory: By type (i.e. ObjectFactory.GetInstance<IFoo>()) By type and name (i.e. ObjectFactory.GetNamedInstance<IFoo>("foo.bar")) I have seen a multitude of examples out there demonstrating how to create an MVC Contr...

Better way of doing strongly-typed ASP.NET MVC sessions

I am developing an ASP.NET MVC project and want to use strongly-typed session objects. I have implemented the following Controller-derived class to expose this object: public class StrongController<_T> : Controller where _T : new() { public _T SessionObject { get { if (Session[typeof(_T).FullName]...

Linq to SQL DataContext Windsor IoC memory leak problem

I have an ASP.NET MVC app that creates a Linq2SQL datacontext on a per-web-request basis using Castler Windsor IoC. For some reason that I do not fully understand, every time a new datacontext is created (on every web request) about 8k of memory is taken up and not released - which inevitably causes an OutOfMemory exception. If I forc...

Save data in MVC

This solution has evaded me all day. I am getting data from my database, but I would like to save the data somewhere as opposed to going to the database for every page. How do I do this? I retrieve the data from my controller... public ActionResult Inquiry(string Num, DateTime Date) { ... Bill myBill = new Bill(Num, Date, myConne...

Compare two RouteValueDictionary instances

I am writing a helper for my application which writes out a menu item for a given strongly typed controller/action as follows: <%= Html.MenuLink<WhateverController>(c => c.WhateverAction(), "Whatever") %> As part of this process, I would like to apply the class of active to the outputted link if the current page and the page linked to...

Asp.net membership provider with locally attached DB

I've created a locally attached SQL Server 2008 Express for an ASP.NET MVC application (in App_Data), but I need to access the built-in users table for relationships to custom models that I'm creating. Since the database is local, it doesn't show up when I run aspnet_regsql.exe. Is there a way around this, or should I be setting up the...