0
      <div class="head">
         @{Html.RenderAction("Top_Head", "My_PartialView");}
      </div>

      <div class="content">
                <div class="content-left">
                        <div class="ad">
                            <img src="~/Images/ImageFontEnd/ad.jpg" />

                        </div>

                    @RenderBody()


                 </div><!--END Content-left-->

              <div class="content-right">
                    <div class="##-lhe-support-login-sp" id="lien-he">
                     <div class="label-238px-box"></div>
                        <img src="~/Images/ImageFontEnd/call-pic.jpg" />
                    </div>
                 @{Html.RenderAction("Search_Price", "My_PartialView");}

2.created My_Partialview

using System;

namespace shopclothes.Controllers
{
    public class My_PartialviewController : Controller
    {
        shoponline1Entities db = new shoponline1Entities();
        // GET: /MyPartialView/

        #region[head]
         [ChildActionOnly]
        public ActionResult Top_Head()
        {

            return PartialView();
        }
        #endregion
     }
}

I follow the correct syntax? why it has been such a problem?

super
  • 2,288
  • 2
  • 21
  • 23
user3763852
  • 1
  • 1
  • 2

3 Answers3

0

The @RenderBody should be use on Layout views, try removing that

Melvinr
  • 514
  • 2
  • 8
0

error for: @{Html.RenderAction("Top_Head", "My_PartialView");} and @{Html.RenderAction("Search_Price", "My_PartialView");}

user3763852
  • 1
  • 1
  • 2
0

It seems there is a bug in using some @html.RenderAction or @html.Action together in layout .I recommend you try the equivalent of renderaction command in other ways.for more help you can take a look at this

Mohsen Zahedi
  • 651
  • 2
  • 10
  • 28