Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7725275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:53:50+00:00 2026-06-01T04:53:50+00:00

Hi I’m having some issues understanding how MVC 3 and razor work. Basically, I

  • 0

Hi I’m having some issues understanding how MVC 3 and razor work. Basically, I have a view that’s rendered with Html.Render partial. basically, I’m trying to render the contents or a partial view inside of div like so.

<div id="mydiv.id">
@{Html.RenderPartial("_BankAccountGrid", Model.CheckAccounts);}
</div>


@if (Model.Any())
{        

        @{Html.Grid(Model).Columns(c =>
        {
                c.For(a => Html.ActionLink(
                    "Edit",
                    "EditBankAccountDetails",
                    "UserManagement",
                    new { Id = a.Id }, new { id = "modalEdit" }));
                c.For(a => a.AccountName);
                c.For(a => a.AccountNumber);
                c.For(a => a.RoutingNumber);
                c.For(a => a.BankName);
                c.For(a => a.CheckAccountType);
                c.For(a => a.AccountType_Id).Visible(false);
                c.For(a => a.version).Visible(false);
                c.For(a => a.IsDefault).Visible(false);
                c.For(a => a.User_Id).Visible(false);
                c.For(a => a.Id).Visible(false);
            }).Render();
        }      
}

However when I look at the DOM in firebug the Table is ALWAYS rendered outside of the div in just a table element. I’ve tried this as well.

@{Html.RenderPartial("_BankAccountGrid", Model.CheckAccounts);}


@if (Model.Any())
{        
    <div id="accounts.grid.div">
        @{Html.Grid(Model).Columns(c =>
        {
                c.For(a => Html.ActionLink(
                    "Edit",
                    "EditBankAccountDetails",
                    "UserManagement",
                    new { Id = a.Id }, new { id = "modalEdit" }));
                c.For(a => a.AccountName);
                c.For(a => a.AccountNumber);
                c.For(a => a.RoutingNumber);
                c.For(a => a.BankName);
                c.For(a => a.CheckAccountType);
                c.For(a => a.AccountType_Id).Visible(false);
                c.For(a => a.version).Visible(false);
                c.For(a => a.IsDefault).Visible(false);
                c.For(a => a.User_Id).Visible(false);
                c.For(a => a.Id).Visible(false);
            }).Render();
        }
    </div>
}

.. but to no avail. Is there something I’m missing?

If I’m not clear enough or you just need more info please just ask instead of voting down.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:53:51+00:00Added an answer on June 1, 2026 at 4:53 am

    You seem to be using MvcContrib.Grid. You should have mentioned that in your question. First make sure that you have downloaded the latest version (the one made for ASP.NET MVC 3, because the older version for ASP.NET MVC 2 doesn’t work well with Razor).

    Then try like this:

    @if (Model.Any())
    {        
        @(Html
            .Grid(Model)
            .Columns(c =>
            {
                c.Custom(
                    @<text>
                        @Html.ActionLink(
                            "Edit", 
                            "EditBankAccountDetails", 
                            "UserManagement", 
                            new { Id = item.Id }, 
                            new { id = "modalEdit" }
                        )
                     </text>
                ).Named("");
    
                c.For(a => a.AccountName);
                c.For(a => a.AccountNumber);
                c.For(a => a.RoutingNumber);
                c.For(a => a.BankName);
                c.For(a => a.CheckAccountType);
                c.For(a => a.AccountType_Id).Visible(false);
                c.For(a => a.version).Visible(false);
                c.For(a => a.IsDefault).Visible(false);
                c.For(a => a.User_Id).Visible(false);
                c.For(a => a.Id).Visible(false);
            })
         )
    }
    

    Notice that I am using a Custom column for the ActionLink and that I am no longer calling the .Render method on the grid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have some data like this: 1 2 3 4 5 9 2 6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.