CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • CSLA4 and Razor WebGrid Help - (StackOverflowException)

    rated by 0 users
    Not Answered This post has 0 verified answers | 3 Replies | 2 Followers

    Not Ranked
    3 Posts
    John Flackett posted on Wed, Oct 12 2011 11:34 PM

    Hi,

    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

    @assetGrid.GetHtml

    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).

    Thanks,

    John

    [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!]

    All Replies

    Top 10 Contributor
    9,475 Posts

    I honestly haven't tried using the WebGrid component.

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

    Rocky

    Top 10 Contributor
    2,279 Posts

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

    Jonny Bekkum, Norway CslaContrib Coordinator

    Not Ranked
    3 Posts

    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

    Page 1 of 1 (4 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems