I am creating a server control in a library project, which has javascript code, the javascript code need to get a button's ID, so I used <%= button.ClientID %>. Then I embed the javascript code as a file in the library project and use ScriptManager to add the script in CreateChildControls().
Dim sm = ScriptManager.GetCurrent(Me.Page)
sm.Scripts.Add(New ScriptReference("xxx.js", "LibraryProjectName"))
But when I run the page, it has a jquery parse error:invalid expression term '>'. So I am guessing the code has been generated but server doesn't convert <%= button.ClientID %> into generated ID format. So what should I do in this case?