The below code works but I am not sure how?
OnClientClick='<%# CreateConfirmation(Eval("EventName"),DataBinder.Eval(Container.DataItem, "EventDate", "{0:ddd, d MMM}")) %>'
Public Function CreateConfirmation(ByVal EventName As String, ByVal EventDate As String) As String Return String.Format("return confirm('Are you sure you wish to register for {0} on {1} ?');", EventName, EventDate) End Function
I have read that <%# %> is a databinding expression, but overhere we are not directly data-bidning (infact returining value from the function CreateConfirmation) and I also thought that it should work with <%= %> but it gives JavaScript error message i.e. Illigal XML character pointing to =
Please could you clarify as to why is this?
Many Thanks.