CSLA4 and Razor WebGrid Help - (StackOverflowException)

CSLA4 and Razor WebGrid Help - (StackOverflowException)

Old forum URL: forums.lhotka.net/forums/t/10768.aspx

drpuff posted on Wednesday, October 12, 2011


Due to a major scope change, I've recently upgraded an existing project from CSLA3.8 + WPF to CSLA4 + MVC3 (razor). I should let you know at this point that I have much less experience with ASP.NET than WPF!

My issue is with trying to use the WebGrid with a 'ReadOnlyListBase' in ASP.NET - it always generates a StackOverflowException.

I can easily display the items in the ROLB, using the sytax shown by Rocky in the ASP.NET MVC ebook (i.e., using a 'foreach' loop), but it seems that using a WebGrid would be more compact (I'm planning on lazy-loading a 3-level BO hierarchy using Ajax).

Here's my code:

@model IEnumerable<AssetROInfo>
    var assetGrid = new WebGrid(source: Model,
                                           defaultSort: "Code",
                                           rowsPerPage: 5,
                                           canPage: true, canSort: true

<h3>Asset List</h3>             @assetGrid.GetHtml(                 tableStyle: "grid",                 headerStyle: "head",                 alternatingRowStyle: "alt",                 columns: assetGrid.Columns(                     assetGrid.Column("Id""ID"),                     assetGrid.Column("Code""Asset Code"),                     assetGrid.Column("Description""Asset Desc")                     )             )    


...and the StackOverflowException is happening on the


call. I am unable to find any examples of using WebGrid with CSLA classes....am I missing something fundamental here?

It just seems like such a simple problem but I can't get to the cause of the problem. Would be grateful if anyone can help with this (or detail an appropriate approach).



[As this is my first post, I just have to say how impressed I've been with Csla since we started employing it 1.5yrs ago - Rocky, you've done a superb job...so thanks very much!]

RockfordLhotka replied on Thursday, October 13, 2011

I honestly haven't tried using the WebGrid component.

Can you post the full stack trace? Maybe there's a clue in there.

JonnyBee replied on Thursday, October 13, 2011

Or could you post a small sample project that fails so we could debug this in CSLA?

drpuff replied on Monday, January 23, 2012

Hey I'm really sorry guys. You responded so quickly to my original post and I was rude and never came back to supply you with more information. Truth be told I had to leave what I was doing at the time and address some other pressing projects...I'll take a look at the initial problem and get back to you ASAP.

Sorry, John

Copyright (c) Marimer LLC