M
mark4asp
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:ImageButton ID="cmdDeleteLogin" runat="server"
SkinID="DeleteButton" CommandName="DeleteLogin"
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$ContentPlaceHolder$repLogins$ctl01$cmdEditLogin"
id="ctl00_ContentPlaceHolder_repLogins_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.clearscreen.com/ragc/archive/2004/10/28/525.aspx> but
there's no clue as to what the solution might be.
itself within a HTML element event.
For instance no matter what permutation of quotes I try here I get
errors on this line:
<asp:ImageButton ID="cmdDeleteLogin" runat="server"
SkinID="DeleteButton" CommandName="DeleteLogin"
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$ContentPlaceHolder$repLogins$ctl01$cmdEditLogin"
id="ctl00_ContentPlaceHolder_repLogins_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.clearscreen.com/ragc/archive/2004/10/28/525.aspx> but
there's no clue as to what the solution might be.