title: ASP.NET MVC. Specific URL for partial views
body: <p>I'm new to ASP.NET MVC. So my question may seem to be little bit naive. Anyway I've spent hours searching for any information on my topic, but no result. So I would be very grateful for your help.</p>
  
  <p>So this is my problem.</p>
  
  <p>In my Index view I have a div, where I put contents of different Partial Views depending on the link that user clicks.</p>
  
  <p>Here's the code.
  Index.cshtml:</p>
  
  <pre><code>&lt;div id="dynamicContent"&gt;&lt;/div&gt;
  
  &lt;a href="#" onclick="@String.Format("updateContent('{0}');", Url.Action("DynamicContent", "Agent", new {name = "AboutCbsrAgent"}))"&gt;About Cbsr Agent&lt;/a&gt;
  
  &lt;a href="#" onclick="@String.Format("updateContent('{0}');", Url.Action("DynamicContent", "Agent", new {name = "ApplicationAreasOfCBSR"}))"&gt;Application Areas Of CBSR&lt;/a&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>function updateContent(contentUrl) {
  
      $.ajax({
          url: contentUrl,
          type: "GET",
          success: function (data) {
              $('#dynamicContent').html(data);
          }
      });
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public class AgentController : Controller
  {
      //Index action
      public ActionResult DynamicContent(string name)
      {
          return PartialView(String.Format("Partial/" + name));
      }
  }
  </code></pre>
  
  <p>So, everything works fine. When user clicks the link, the appropriate partial view is loading into the div.
  The problem is that in adrees bar of a browser i get the following URL: example.com/Agent# whatever link i click.</p>
  
  <p>So my question: Is there any way to generate the unique URL for each partial view? For example: <code>example.com/agent/partial/AboutCbsrAgent</code>. And is it possible to make so that when I paste this link into the browser's address bar, the whole view and NECESSARY partial view will be displayed?</p>
  
  <p>Thank you in advance for your help!</p>