I agree with José this doesnt look standard.
If its a custom control that has a client side API then have you tried just typing out its identifier rather than using the <% %>
tags...
You havnt mentioned what 3rd party toolkit your using but I know with DevExpress their components (such as the grid) have a property that allows you to set the client side instance name. You can get the grid to then call back from your client code by doing something like gridClientName.PerformCallback()
.
If it is ComponentArt's grid you are using then I think you can set the grids client name with the ClientObjectId
property and then use gridClientName.callback()
in your Javascript.
If you just want to call an ASP.NET function from your Javascript code you could use an ASP.NET Script Manager AJAX control. I will give you an example below...
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True">
</asp:ScriptManager>
<script runat="server">
[System.Web.Services.WebMethod]
public static String Msg()
{
String userName = "Chalkey";
return userName;
}
</script>
<script type="text/javascript">
PageMethods.Msg(OnSucceed);
function OnSucceed(result)
{
alert(result);
}
</script>
Hope some of this is useful! :)