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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:23:42+00:00 2026-06-11T00:23:42+00:00

I am trying to pass a modelclass store to a RenderPartial. The goal for

  • 0

I am trying to pass a modelclass store to a RenderPartial. The goal for the renderpartial is to change/set values on this (store)model. I have been trying like this:

@{ Html.RenderPartial("test", new store(){Output=""}); }
@{ Html.RenderPartial("test", new store(){Output2=""}); }


public class store
    {
        public string Output { get; set; }
        public string Output2 { get; set; }
    }

the Partial ‘test’ has to change the Output properties. Is it uberhaupt possible and if yes how to do this? The renderpartial contains a javascript to calculate the value of the properties.

  • 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-11T00:23:43+00:00Added an answer on June 11, 2026 at 12:23 am

    RenderPartial is meant to get either none of the data from the parent or a part of the model.
    The overloads at:
    http://msdn.microsoft.com/en-us/library/system.web.mvc.html.renderpartialextensions.renderpartial(v=vs.108).aspx
    Tell you object isn’t a custom object but meant to be part of the Model, ex Model.Customers

    Pass the required value from your model to the partial and let the partial create it’s own objects.

    If you really want to pass it to the partial then create a new view model for your parent view and set the Output property in your viewmodel and pass it to the partial.

    Note also that the partial gets it’s own copy of the data and cannot update the parents copy so that may defeat what you actually want here.

    If you need some other calculate data do it in your controller prior to passing it to the view if possible.

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

Sidebar

Related Questions

Trying to pass some values into an imagebutton click event, something like this: <asp:ImageButton
I'm trying pass in a url as a paramter to my controller like this:
When trying to pass a table built with HTML in my servlet like that:
Trying to pass the values but not making progress. Scenario : Have a public
I have a controller like this, but no model class backing it. class UserInviteController
im trying to pass a generated choices to my model field, please where is
model: class Store(models.Model): name = models.CharField(max_length = 20) class Admin: pass def __unicode__(self): return
I am trying to pass an object of model class for edit but receing
Iam trying to pass dynamic argument values i.e username from request using spring ioc.But
I'm trying to pass a command parameter with my command. I have commands in

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.