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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:08:05+00:00 2026-05-31T13:08:05+00:00

I have a MessagingContainer that is going to display an Inbox and Outbox partial

  • 0

I have a MessagingContainer that is going to display an Inbox and Outbox partial view. The Inbox and Outbox will toggle within the div on a click event. Since the Inbox is getting rendered on load, passing the Model is easy.

MessagingContainer –

<div id="messagingContainer">
@{
    Html.RenderPartial(@"~Inbox.cshtml", Model);
}</div>

There is a link to get to the Outbox that will trigger an ajax event.

$('#outBox_@(instanceId)').unbind('click').bind('click', function () {
        $.ajax({
            type: 'POST',
            url: '/Messaging/GetOutbox',
            data: data,
            success: function (result) {
                $('#messagingContainer').html(result);                  
            },
            error: function (req, status, error) {
                alert('Failed Method: MessagingController.GetOutbox');
            }
        });
    });

The Model has multiple properties and objects in it so trying to recreate it as a JSON array would be long and tedious. My only thought right now is to pass in the Model.Id to the controller, re-fetching the Model object and then passing that newly fetched Model to the Outbox partial.

I was just curious if there was a more trixy way to to accomplish this that I haven’t come across yet.

  • 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-31T13:08:06+00:00Added an answer on May 31, 2026 at 1:08 pm

    I might suggest that you consider having separate inbox/outbox actions with the same or different views, then use Html.Action() to render the Inbox when in your index action, delivering just the partial HTML when you toggle to the outbox.

    Controller

    public ActionResult Index()
    {
        var pageModel = new PageModel { ... };
        return View(pageModel);
    }
    
    public ActionResult GetInbox()
    {
        var mailboxModel = new InboxModel { ... };
        return PartialView( "_Mailbox", mailboxModel );
    }
    
    public ActionResult GetOutbox()
    {
        var mailboxModel = new OutboxModel { ... };
        return PartialView( "_Mailbox", mailboxModel );
    }
    

    View (index)

     <div id="messagingContainer">
     @{
           Html.RenderAction("getinbox");
     }
     </div>
    

    Your AJAX code basically remains the same, but you are only rendering the partial HTML for just the outbox in the response and you can probably reuse a fair amount of the code for your Inbox/Outbox actions, likely including the partial view itself.

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

Sidebar

Related Questions

have you ever found a problem when assigning a click event handler for your
Have a fun issue with sharepoint calendar view filtering. That code works fine: SPSecurity.RunWithElevatedPrivileges(delegate()
Have a rails app that is supposed to display a list of products/managers. After
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
Have a bunch of WCF REST services hosted on Azure that access a SQL
Have a look at one of my websites: moskah.com The problem is that it
Have a simple contact us XPage created. Have server side validation in place that
Have a problem that seems easy on paper but i'm having a big problem
Have some dates in my local Oracle 11g database that are in this format:
have the following text file: <div> <asp:HyperLinkField HeaderText=Hello World of Regular Expression /> </div>

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.