Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RenderPartial on Controller

Posted on 2013-06-10
1
Medium Priority
?
361 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 700 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Integration Management Part 2
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

885 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