title: To load an Iframe dynamically on click of a link in MVC3
body: <p>Hi i am developing an application inMVc3<br>
  I have a model containing </p>
  
  <pre><code>Hobbyname 
  Hobbyurl
  </code></pre>
  
  <p>I have drawn a table and in the first column i fetch all the hobbynames and display it as a link.
  Hobbyurl contains the url of a page associated with the Hobbyname
  Now when i click the Hobbyname from lefthand side i want the contents to be loaded in the right side i use an Iframe to display the contents so i need the Iframe to be loaded again and again on click.</p>
  
  <p>To fetch the Hobbynames i used the foll code:</p>
  
  <pre><code> &lt;td&gt;
   &lt;ul&gt;
    @foreach (var item in Model)
    {
     &lt;li&gt; @Html.ActionLink(item.HobbyName, "Hobbies")&lt;/li&gt;
    }
   &lt;/ul&gt;
   &lt;/td&gt;
   &lt;td&gt;
   &lt;div&gt;
   &lt;iframe id="iframe"&gt;&lt;/iframe&gt;
   &lt;/div&gt;
   &lt;/td&gt;
  </code></pre>
  
  <p>and Here is the script:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $('a').click(function () {
      $('iframe').attr('src', "/HobbyHomes/Test");
  }); 
  &lt;/script&gt;
  </code></pre>
  
  <p>But i am not able to load the Iframe on click of the link.
  Please help me</p>