Error in passing value from cs to jquery
Hi,I want to pass value from cs file to jquery file
following is working code
cs file
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Heading="Baiju";
}
}
public string Heading { get; set; }
jquery file
$(document).ready(function () {
var title = "<%=Heading%>";
alert(title);
});
this is working fine and alert message is Baiju
problem is if i remove jquery file and write the code in another js file and call it in the page
like
<script type="text/javascript" language="javascript" src="bd.js">
it will not work
then alertmessage will be
"<%=Heading%>";
How to solve this
Regards
Baiju