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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:53:53+00:00 2026-05-25T21:53:53+00:00

I have the following structure: Views: Home Articles Partial Views: Book Classes Intro Faq

  • 0

I have the following structure:

Views:

Home

Articles

Partial Views:

Book

Classes

Intro

Faq

On the top of the page, in my header, is a navigation menu – containing multiple Ajax.ActionLinks that call into different methods in my HomeController class to fetch a particular partial view and then place that content in my center DIV. So I can click on the Faq link, and the content in the center DIV of my page will now contain the partial view for my Faq. Now, I have an Articles view that will look completely different and therefore needs to be separated as it’s own view as opposed to a partial view, and, the problem that I am running into is if I click on my Html.ActionLink for “Articles”, I am navigated to my Articles view, which is what I want, but then if I click on one of the other links that are Ajax.ActionLinks, I need (somehow) the view to change back to my Home view so that I can then retrieve the requested partial view and place that into my center DIV. Any idea how I can do this? Right now the AJAX.ActionLink, when being called while on my Articles View, is calling into my HomeController, but then trying to replace the content in my center DIV (which doesn’t exist in my Articles view), and additionally, it’s not loading the HomeView.

Any thoughts on how to best achieve this? Also, I am not using the Razor engine.

So, the navigational menu, which is a set of links, resides in my Site.Master file. Here is one of the links that I have:

  <%= Ajax.ActionLink("Book", "LoadBook", new AjaxOptions() { HttpMethod = "Post", UpdateTargetId = "content", InsertionMode = InsertionMode.Replace })%>

When clicking on this link, the method LoadBook in my HomeController is called. Refer to the code below:

public ActionResult LoadBook()
{
    return PartialView("Book");
}

In my Home.aspx view, I have the following code:

<div id="content">
   <% Html.RenderPartial("Intro"); %>
</div>

This code will automatically load the partial view for my “intro” (introduction) by default whenever initially loading the Home view. So basically, since the link for “Articles” is Html.ActionLink (as opposed to Ajax.ActionLink), when it is clicked I am taken to the Articles view. When I click on, for example, the “Book” Ajax.ActionLink in my Site.Master header while on the Articles view, the code will try to update a “content” DIV with the “Book” partial view. This behavior is only wanted when on the Home view, for obvious reasons. So, how can I have different behavior for my Ajax.ActionLinks when viewing a view that is different than my Home view?

Thanks!

Chris

  • 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-25T21:53:54+00:00Added an answer on May 25, 2026 at 9:53 pm

    This sort of architecture is going to give you lots of problems. For stanrtes, you can’t link to any pages. All your content happens in your main page.

    This works ok for an app like GMail, but most people will be confused as to why they can’t save a shortcut to a page, or send a link to a friend.

    HTML is designed to have a unique URL for each page. You’re fighting upstream trying to do something different. Suppose you want to use fragments to jump to other sections of your page. you can’t do that.

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

Sidebar

Related Questions

I have two views in a Drupal page with the following structure: <div> <div>Some
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I have the following structure: class Base { } class Child : Base {
I have the following structure public class MyClass : MyBaseClass<System.Int32> { } In a
Ok, I have the following structure. Basically a plugin architecture // assembly 1 -
I have the following XML structure: <?xml version=1.0 ?> <course xml:lang=nl> <body> <item id=787900813228567
I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL
I have the following data structure (a list of lists) [ ['4', '21', '1',
I have the following entity structure: public class Party { public Int32 PartyId {
I have the following class structure FlowerDAO with the fields (mapped using Hibernate): id

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.