I'm using ASP.NET MVC + NHibernate + Fluent NHibernate and having a problem with lazy loading.
Through this question (http://stackoverflow.com/questions/2519964/how-to-fix-a-nhibernate-lazy-loading-error-no-session-or-session-was-closed), I've discovered that I have to implement the Open Session in View pattern , but I don't know how.
...
I was wondering if it's possible to authorize parts of a view inside the view.
For example, I understand how to authorize the entire controller in this method
<HandleError()> _
Public Class HomeController
Inherits System.Web.Mvc.Controller
Function Index()
Return View()
End Function
<Authorize(Roles:="Administrators")> _
...
I need the actual debug symbols from the released version of ASP.NET MVC 2 (the version that gets installed via the web platform installer).
I know I can download the source, build and use the debug symbols from that. But there are a couple issues with that approach:
Requires that all other dependencies be rebuilt using this version o...
Here's the situation:
I've got two partial views. One has a form.
What needs to happen is when the form is posted via an AJAX request, if the operation succeeds, the area with the second partial is repopulated with the content. However, if the posted data was invalid, the original partial is repopulated with an error message.
I'm usin...
Once an asp.net MVC project has a web deployment project associated with it, there doesn't seem to be a way to avoid deploying when you build the MVC project. I still want to be able to debug my MVC project locally and avoid deploying new versions of it. How do I configure the web deployment project to skip the deployment step when I'm t...
I have 2 actions on a controller:
public class CalculatorsController : Controller
{
//
// GET: /Calculators/
public ActionResult Index()
{
return RedirectToAction("Accounting");
}
public ActionResult Accounting()
{
var combatants = Models.Persistence.InMemoryCombatantPersistence.GetCombatan...
Hello guys or girls..!
I'm new in ASP.NET and I have a problem...
When I want to cache I View or an Action like this :
<%@ Page title="" language="C#" masterpagefile="~/Views/Shared/MemberHome.Master" inherits="System.Web.Mvc.ViewPage<IndexViewData>" %>
<%@ OutputCache duration="400" varybyparam="divId;regionId;page" %>
I know tha...
We're considering moving forward with a ASP.NET MVC project and the subject of routing versus parameters came up.
Seeing as how you can easily set up either or a combination of both in ASP.NET MVC, are there any considerations that I should be aware of when using one or the other?
...
Fairly simple issue which is solved in PHP by using a static variable.
private static $pages;
public function Pages() {
if($pages == null) {
$pages = new PageCollection();
$pages->findAll();
}
}
Everywhere in my code I use Pages()::someFindFunction() to make sure the results are fetched only once, and I use tha...
Is it possible to create a generic method with a definition similar to:
public static string GenerateWidget<TypeOfHtmlGen, WidgetType>(this HtmlHelper htmlHelper
, object modelData)
// TypeOfHtmlGenerator is a type that creates custom Html tags.
// GenerateWidget creates custom Html tags whi...
Hi, I'd like to implement Dispatching on the host header like stackexchange team did. Any ideas?
...
Third try at fixing this tonight - trying a different approach than before now.
Given a jQuery Sortable List..
<ul id="sortable1" class="connectedSortable">
<li class="ui-state-default" id="item1">Item 1</li>
<li class="ui-state-default" id="item2">Item 2</li>
<li class="ui-state-default">Item 3</li>
<li class="ui-stat...
How would I model a system that needs to be able to provide content in a format that would be consumable by iphone, Android or web browser (or whatever). All a new consumer would have to do is build a UI with rules on how to handle the data. I'm thinking something RESTful returning JSON or something.
I'm really looking for suggestions ...
We use MVC controllers that access System.File.IO in our application and they work fine in localhost (IIS 6.0-based Cassini). Deploying to IIS7, we have problems getting the controllers to work because they throw UnauthorizedAccessExceptions.
We have done the following to try to resolve the issue:
- Set NETWORK SERVICE and IUSR account...
I've looked at http://stackoverflow.com/questions/817325/asp-net-mvc-routing-legacy-urls-passing-querystring-ids-to-controller-actions and several other similar posts for legacy URL routing, but I can't get past the error "The RouteData must contain an item named 'controller' with a non-empty string value." Looking this up on line didn't...
I'm sure this has been answered before, but I've spent the last three hours looking for an acceptable solution and have been unable to find anything, so I apologize for what I'm sure is a repeat.
I have two domain objects, Player and Position. Player's have a Position. My domain objects are POCOs tied to my database with NHibernate. I h...
I'm learning Spring MVC at the moment and comparing it to ASP .NET MVC. Is there a way to use partial views in java (like .ascx partials in ASP .NET MVC), so i can associate it with action method of some controller and pass model data to it.
...
If you have a Car model with 20 or so properties (and several table joins) for a carDetail page then your LINQ to SQL query will be quite large.
If you have a carListing page which uses under 5 properties (all from 1 table) then you use a CarSummary model. Should the CarSummary model be populated using the same query as the Car model?
...
simply i'm doing a test
i have a div called test and mvc action in the client controler
the view
and the controler
public string testout()
{
return DateTime.Now.ToString();
}
and i'm using jquery to update the div
$("#B1").live("click", function() {
$("#test").load("/client/...
Hi,
I am creating a very simple forum as my first MVC project. My database layout is rather simple:
[ForumThread]
Id
Title
[ForumPost]
Id
ThreadId
Message
ParentId // To tell which post this post should hang on to
Created
CreatedBy
Updated
UpdatedBy
I am creating a view for the ForumThread for displaying the list of threads and to b...