Solved

RenderPartial on Controller

Posted on 2013-06-10
1
340 Views
Last Modified: 2013-06-13
I have a view in my project that will display the contents of a controller. I want to take that controller and use it in another view to display the same contents albeit set for a different variable (the controllers context is determined on the value of a variable called pairingID). I am using knockout to display all the data. The error I get is that the view cannot access a nonstatic property in a static context. It must be a nonstatic property to work in the main view where it is rendered, so changing that is out of the question. How can I change or set the context of the view/render so it will display the control.

    <!-- ko with: pairingActivity -->
    Html.RenderPartial("Components/PairingActivity", CRC.TradeBreaks.MVC4.Models.Windows.PairingActivityWindow.PairingActivity);
    <!-- /ko -->
0
Comment
Question by:rawilken
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 175 total points
ID: 39235771
You're attempting to pass a class name when you should be passing an instance of a class. Change "CRC.TradeBreaks.MVC4.Models.Windows.PairingActivityWindow.PairingActivity" to the name of a variable that points to an instance of that class.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question