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 3607424
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:22:26+00:00 2026-05-18T21:22:26+00:00

Basically, I started working on this app knowing nothing about web development which is

  • 0

Basically, I started working on this app knowing nothing about web development which is severely inhibiting my search-fu. Probably should read a book, but that’s not likely. Using ASP.NET MVC3 RC2, I’m trying to make a strongly typed partial view which can navigate to related items, as well as maintaining a bread crumb trail (which I thought would be a List in the ViewBag?). A good analogy would be a dictionary page with a thesaurus sub-view.

class Entry
{
   string Name;
   string Definition;
   IEnumerable<Entry> Synonyms;
}

Primarily the page shows the word and its definition, etc. But there’s a div with synonyms that you can click to see the selected word’s synonyms, replaced w/ ajax.

I was initially thinking I needed to do an html helper, but then I saw stuff about returning PartialView from my controller which seems a lot better.

I’m having trouble piecing together all the pieces of the puzzle. A sample or outline would be great.

Thanks!

  • 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-18T21:22:27+00:00Added an answer on May 18, 2026 at 9:22 pm

    Man, I knew I should have worked on it a little longer before asking.

    So, here’s the recipe:

    1. Make a function in the controller, Synonym(id) { return PartialView(GetEntry(id)); }
    2. Make a partial view, Synonym.cshtml, strongly typed to Entry.
    3. Display the partial view in your main display with <div id="Synonyms">@{Html.RenderAction("Synonym", @Model.Id);}</div>
    4. For the ajax navigation link inside Synonym.cshtml, use something like this

      @foreach(Entry syn in @Model.Synonyms)
          @Ajax.ActionLink((string)@syn.Name, "Synonym", 
              new { id = @syn.Id }, new AjaxOptions { UpdateTargetId = "Synonyms" })
      

    One thing that briefly tripped me up was the new { id = @syn.Id } because the parameter name in my controller was actually number, I had to use new { number = ... }

    Oh, and I asked about navigation. I think the browser’s back button will be sufficient for most navigation, but still wanted a “Back to Current Word” link. For that I did the following:

    1. Modified Controller.Synonym to take another parameter, int orig and set ViewBag.OrigId = orig; before returning.
    2. Modified the ActionLinks to say new { id = @syn.Id, orig = @ViewBag.OrigId }
    3. Created the back link inside Synonym.cshtml – @Ajax.ActionLink("Back To Current Word", "Synonym", new { id = @ViewBag.OrigId, orig = @ViewBag.OrigId }, new AjaxOptions { UpdateTargetId = "Synonyms" })
    4. Modified the call to @Html.RenderAction to pass an object like in the ActionLinks new { id = @Model.Id, orig = @Model.Id }

    If someone else comes up with a better answer that makes me want to rewrite my stuff, I’ll accept theirs instead. And I’d love feedback on whether I’m missing anything, like how I could avoid the second parameter to Controller.Synonym or other simplifications or improvements.

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

Sidebar

Related Questions

I started using the MoveMe sample to get touch input working. basically, I define
I im developing a web application, its a servlet which basically acts as a
Basically what I want to do it this: a pdb file contains a location
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I am trying to restart a service from a php web page. Here
I am currently working on some older java code that was developed without App
When I started learning Java I too started with the ubiqutous Hello world app.
Basically I have some code to check a specific directory to see if an
Basically I'm going to go a bit broad here and ask a few questions
Basically, I would like a brief explanation of how I can access a SQL

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.