I have the working code pasted below which has a function called FormatStatus() as part of inline code and the actual definition is in the code behind (C#). My question is if I move the function (FormatStatus()) into an external javascript file how can i call it from the inline code.
<asp:Label ID="lblSts" runat="server" Text= '<%# FormatStatus(Eval("StsId").ToString()) %>' >
</asp:Label>
My code behind :
protected string FormatStatus(string Id)
{
string formatText = string.Empty;
switch (int.Parse(Id))
{
case 0:
formatText = "New";
break;
case 1:
formatText = "Old";
break;
.....
}
return formatText;
}