title: Refresh div content after OnGet method in Razor Pages
body: <p>I've got 1 data in view which is assign in OnGet method as a ViewData.</p>
  <p>OnGet method:</p>
  <pre><code>public void OnGet(string parameter = &quot;default&quot;)
  {
      ViewData[&quot;SelectedParam&quot;] = parameter;
  }
  </code></pre>
  <p>My View:</p>
  <pre><code>@{
      var selectedParam= ViewData[&quot;SelectedParam&quot;];
  }
  
  &lt;h1&gt;Some Page&lt;/h1&gt;
  &lt;hr /&gt;
  &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col-3&quot;&gt;
          &lt;div class=&quot;nav flex-column nav-pills&quot; id=&quot;v-pills-tab&quot; role=&quot;tablist&quot; aria-orientation=&quot;vertical&quot;&gt;
              @await Component.InvokeAsync(&quot;MyComponent&quot;)
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;col-9&quot;&gt;
          &lt;div id=&quot;mainDiv&quot;&gt;
              @selectedParam
              &lt;hr /&gt;
              @if (string.IsNullOrEmpty(selectedParam.ToString()))
              {
                  &lt;h5&gt;No param selected&lt;/h5&gt;
              }
              else
              {
                  &lt;h5&gt;@selectedParam selected&lt;/h5&gt;
              }
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>My component is sending parameter, View is changing value of ViewData[&quot;SelectedParam&quot;] and now I want to refresh the content of a div.</p>
  <p>JQuery:</p>
  <pre><code>$(document).on('click', 'componentElement', function () {
      var parameterResult = &quot;test&quot;;
      $.ajax({
          url: '/Index',
          type: 'get',
          data: {
              parameter: parameterResult 
          },
          success: function () {            
              &lt;!-- here I need to reload --&gt;
          }
      });
  });
  </code></pre>
  <p>I tried to do <code>location.reload()</code>, but I must refresh only this div, not the whole page, tried also with <code>$('#mainDiv').load(' #mainDiv')</code>, but still nothing</p>