title: Return a partial view and append it to a div in index.cshtml view Mvc4
body: <p>I am trying to do something like, i have an index view which has some  tags on each on one when click i want to return a partial view and append it to the div in main index.cshtml view 
  my code i below</p>
  
  <p><strong>Index.cshtml</strong></p>
  
  <pre><code>@model OyeAPI.Models.User
  @{
      object user = Session["userId"];
      ViewBag.Title = "Index";
  }
  
  
  &lt;link href="@Url.Content("~/Content/css/style.css")" rel="stylesheet"/&gt;
  
  &lt;div class="main_Container"&gt;
  
  
          @if (Session["userId"] == null) { 
              &lt;div class="login_div"&gt;
               @Html.Partial("~/Views/Shared/_signin.cshtml")
              &lt;/div&gt;
          }else
          {
              &lt;div style="height:100px;"&gt;
                  &lt;p&gt;OyePortal&lt;/p&gt;
              &lt;/div&gt;
  
             // &lt;p&gt;@Html.ActionLink("clickme", "callLogs", "contactWeb")&lt;/p&gt;
  
  
              &lt;div style="position:relative; left:400px;"&gt;
                  &lt;div&gt;
  
  
                      &lt;p id="contacts"&gt;Contacts&lt;/p&gt; | &lt;p id="callLogs"&gt;Call Logs&lt;/p&gt; | 
                      &lt;p id="messages"&gt;Phone Messages&lt;/p&gt; | &lt;p &gt;Groups&lt;/p&gt;
  
  
                  &lt;/div&gt;
                  &lt;div id="container_inner_frame"&gt;
  
                      &lt;h1&gt;Welcome fuck it  &lt;a href="#" id="addTest"&gt;clickme&lt;/a&gt;   &lt;/h1&gt;
  
  
  
  
  
                  &lt;/div&gt;
  
              &lt;/div&gt;
          }
  
  &lt;/div&gt;
  
  
  &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
  @*&lt;script src="@Url.Content("~/Scripts/jquery-1.10.2.js")" type="text/javascript"&gt;&lt;/script&gt;*@4
  
  &lt;script type="text/javascript"&gt;
  
      $("#contacts").on("click", function () {
  
  
          $("#container_inner_frame").html('@Html.Partial("~/Views/Shared/_contacts.cshtml")');
  
           });
  
      $("#callLogs").on("click", function () {
  
  
          $("#container_inner_frame").html('@Html.Partial("~/Views/Shared/_callLogs.cshtml")');
  
  
  
          });
  
      $("#messages").on("click", function () {
  
          $("#container_inner_frame").html('@Html.Partial("~/Views/Shared/_Phonemessages.cshtml")');
  
         });
  
  &lt;/script&gt; 
  </code></pre>
  
  <p><strong>shared View _callLogs.cshtml</strong></p>
  
  <pre><code>@model OyeAPI.Models.CallLogs
  @{
      List&lt;Model.CallLogsModel&gt; ListCallLogs = (List&lt;Model.CallLogsModel&gt;)ViewData["Data"];
      Int64 CallID = 0;
      string callNumber = null;
      string callDuration = null;
      string callType = null;
      string date = null;
      string daytime = null;
  
  }
  
  &lt;div class="main_Container"&gt;
      &lt;div&gt;
          &lt;div&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Contact ID&lt;/li&gt;&lt;li&gt;Contact Name &lt;/li&gt;&lt;li&gt;Contact Number&lt;/li&gt;
                  &lt;/ul&gt;
  
          &lt;/div&gt;
  
          @if (ListCallLogs != null) 
          {
  
              foreach (var item in ListCallLogs) 
              {
  
                  CallID = item.CallId;
                  callNumber = item.PhoneNumber;
                  callDuration = item.CallDuration;
                  callType = item.CallType;
                  date = item.CallDate.ToShortDateString();
                  daytime = item.CallDayTime.ToShortTimeString();
  
                  &lt;div&gt;
  
                      &lt;ul&gt;
                          &lt;li&gt;@CallID&lt;/li&gt;&lt;li&gt;@callNumber &lt;/li&gt;&lt;li&gt;@callDuration&lt;/li&gt;&lt;li&gt;@callType&lt;/li&gt;&lt;li&gt;@date &lt;/li&gt;&lt;li&gt;@daytime&lt;/li&gt;
                      &lt;/ul&gt;
  
                  &lt;/div&gt;
  
              }
          }
          else
          {
              &lt;p&gt;Empty String list no messages&lt;/p&gt;
          }
  
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Controller contactWeb function callLogs</strong></p>
  
  <pre><code> [HttpPost]
           [AllowAnonymous]
          public ActionResult callLogs()
          {
              Int64 userID = Convert.ToInt64(Session["userId"]);
              try 
              {
                  List&lt;CallLogsModel&gt; callModel = new List&lt;CallLogsModel&gt;();
                  ICallLogs callLogObject = new CallLogsBLO();
                  callModel = callLogObject.GetCallLogs(userID);
  
                  ViewData["Data"] = callModel;
  
  
              }
              catch (Exception e)
              {
  
              }
  
              return PartialView("_callLogs", ViewData["Data"]);
  
          }
  </code></pre>
  
  <p>But its not working, when i run the code before login it hit the _callLogs shared view first and after that it show the login screen and when i click the callLogs it dosen't display any thing. i my be missing something</p>