How do I include a server tag within a javascript parameter which is
itself within a HTML element event.
For instance no matter what permutation of quotes I try here I get
errors on this line:
<asp:ImageButto n ID="cmdDeleteLo gin" runat="server"
SkinID="DeleteB utton" CommandName="De leteLogin"
CommandArgument ='<%# Eval("LoginID") %>'
OnClientClick =
'return confirm(Are you certain you want to delete: <%#
Eval("UserName" ) %>)' />
I want the final code to look something like this:
<input type="image"
name="ctl00$Con tentPlaceHolder $repLogins$ctl0 1$cmdEditLogin"
id="ctl00_Conte ntPlaceHolder_r epLogins_ctl01_ cmdEditLogin"
src="../App_Themes/SomeSite_Admin/images/edit_button.gif "
onclick="return confirm('Are you certain you want to delete: Joe
Doe');"
style="border-width:0px;" />
Clearly the problem is that double quotes can't be used to enclose <%#
Eval("UserName" ) %but I need to enclose the argument to the
javascript confirm function in qutoes.
I found out what the problem was here
<http://blogs.clearscre en.com/ragc/archive/2004/10/28/525.aspxbut
there's no clue as to what the solution might be.