MVC Partial View

Topics: MVC
Jul 3, 2011 at 7:52 PM

I have created a new MVC 3 razor application and modified the about.cshtml  to include code

 <script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>

<div id="divInsert" />

     <a id="aShowInsert">dialog register</a>

<script type="text/javascript">
    var dialog;
    $(document).ready(function () {
        $("#aShowInsert").click(function () {
            $("#divInsert").load("Home/parialContent", function () {
                alert('dialog content');
                $("#inputCloseModal").click(function () {
                    return false;

            return false;
        dialog = $("#divInsert").dialog({
            title: "Insert",
            resizable: false,
            modal: true,
            autoOpen: false

In the HomeController.cs i added the code

        public ActionResult parialContent()
            return PartialView("/Views/Home/Content.cshtml");

Create a new view "Content.cshtml" with some text.

This application run in the external CMS project and show a dialog with text but when i try to implement somehting like this in Composite CMS the code does not show the dialog.

Debugging shows that the code does read the partial view Content.cshtml.

If someone has experience with Partial Views in C1 CMS system i would greatly appreciate the insight to make this work.

Thanks in advance.

Jul 4, 2011 at 8:06 AM
Edited Jul 4, 2011 at 8:07 AM

Hi, Can you add some parameter to parialContent() ?

public ActionResult parialContent(string str)
            return PartialView("/Views/Home/Content.cshtml");

  $("#divInsert").load("Home/parialContent", {string:"test"},function () {


Problem can be that "load" send GET request instead POST (GET Ajax request can have problems in combination IIS + MVC + C1)

Jul 4, 2011 at 4:15 PM


Thanks for the help again.