Solved

RenderPartial on Controller

Posted on 2013-06-10
1
337 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 74

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now