I am trying to pass multiple Eval()
arguments to a JavaScript function from an .aspx
file, but I keep getting compiler errors. I am new to JavaScript and have never really used Eval()
before. Where am I going wrong?
NB: The line shown below is actually all on one line, but is wrapped here for clarity:
<asp:LinkButton runat="server" Text='<%#Eval("Title")%>'
OnClick='javascript:ShowEventDetails'
CommandArgument='<%#
Eval("EventID").ToString() & Eval("Title").ToString() &
Eval("Location").ToString() & Eval("StartTime").ToString() &
Eval("Description").ToString() & Eval("Link").ToString() &
Eval("ContactFirstName").ToString() & Eval("ContactLastName").ToString() &
Eval("ContactEmail").ToString() & Eval("InsertionTime").ToString() &
Eval("EventAdmin").ToString()%>); ' />
Are there better ways of doing this? If so, what are they?