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

  • SEARCH
  • Home
  • 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 4555460
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:13:43+00:00 2026-05-21T17:13:43+00:00

I need some clear mind thinking to provide some good suggestion how this kind

  • 0

I need some clear mind thinking to provide some good suggestion how this kind of thing should be done to its best.

Problem

I’m building an Asp.net MVC application. Most of my views have a toolbar at the top. Toolbar can have several different items on it like:

  • buttons
  • notes
  • flush items (dynamic width space that’s used to put some buttons to the far right side of the toolbar)
  • etc.

To follow DRY principle I created a set of shared partial views (Toolbar, Toolbar.Button etc.) that render a predefined toolbar object. These partial views are of course strong typed.

Then I have my strong type views whose models are related to the data they display. But they quite often have a toolbar on them as well. So before calling Html.RenderPartial("Toolbar", toolbar) I have to prepare this IList<ToolbarItemBase> object list to pass it to it.

The problem is I’m preparing these in the view itself. This toolbar object list is always the same for a particular page and is also localised. Toolbar button item also has a Url property that’s set using Url.Action() helper, which makes it impossible to simply store serialized toolbar instances in a database. The thing is these toolbar definitions may get really large (think of Word ribbon and the amount of items in it)

Question

What do you suggest, where should I create my localised toolbar instances without cluttering views’ code? Since they don’t change at all, they could most probably be static I guess…

  • 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-05-21T17:13:44+00:00Added an answer on May 21, 2026 at 5:13 pm

    I’d consider using the Action/RenderAction helpers in ASP.NET MVC 3.

    Basically the Action helper let’s you set up a “child request” to a controller action that can build a model and render a partial view (and the results of the partial view will render into the outer view where you use @Html.Action(…)).

    So … in your scenario you’d have a controller action dedicated to building the view model for the toolbar, and rendering the toolbar partial. Call this action using Html.Action from the layout or content view that needs a toolbar.

    Hope that helps,

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

Sidebar

Related Questions

I need to do testing on clean machines frequently so I need some kind
Need some help to solve this. I have a gridview and inside the gridview
Need some help with this problem in implementing with XSLT, I had already implemented
Need some help gathering thoughts on this issue. Our team is moving ahead with
Need some best practice advice here... Navigation based application. Root view is a UITableView
Excuse me, I do not make a clear question in english. I need some
I need some help with re-working the logic on this php code. What I'd
I need some help to implement this roll over / out effect. This is
I need to do some clean up work when I am going to terminate
Need some help, please. I have a line of horizontal thumbnails loaded as ONE

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.