How to add javascript function in c# by using htmlgeneric control
<p>I am working on asp.net c# . I want to add javascript function in c# by using htmlgeneric control .I have used code , </p>

<pre><code>HtmlGenericControl scriptTagLinks = new HtmlGenericControl("script");
scriptTagLinks.Attributes["type"] = "text/javascript"; 
string scrip = "$(function () {$([src='" + url + "']" + ").pinit();});";
    // txtDesc.Text = rdr.GetString(4);
    // TxtLink.Text = rdr.GetString(6);
scriptTagLinks.Attributes["src"] = scrip;
this.Controls.Add(scriptTagLinks);
</code></pre>

<p>But i should get like this , </p>

<pre><code> &lt;script type="text/javascript"&gt;
   $(function () {


        $("[src='/pinterest/portals/0/Images/about-person3.jpg']").pinit(); 
        $("[src='/pinterest/portals/0/Images/about-us-group.jpg']").pinit();

    });
    &lt;/script&gt;
</code></pre>

<p>But i am getting this as</p>

<pre><code> &lt;script src="$(function () {$([src='/pinterest/portals/0/Images/about-us-group.jpg']).pinit();});" type="text/javascript"&gt;
</code></pre>

<p>How can i add <code>$([src='/pinterest/portals/0/Images/about-us-group.jpg']).pinit();});</code> between  tags .</p>
