The server tag is not well formed for imageButton

740 Views Asked by At
<asp:ImageButton ID="Image1" Width="50px" Height="50px" runat="server" ImageUrl='<%# "ImageHandler.ashx?ImID="+ Eval("Ifile")  %>' OnClientClick='<%#"javascript:window.open(' ImageHandler.ashx?ImID="+ Eval("Ifile")  "')"%>' />

Does anyone tell me what's wrong with this tag? I'm getting error on this tag.

1

There are 1 best solutions below

0
On BEST ANSWER

You cannot use an apostrophe ' inside the binding, use &#39;.

<asp:ImageButton ID="Image1" Width="50px" Height="50px" runat="server" ImageUrl='<%# "ImageHandler.ashx?ImID="+ Eval("Ifile") %>' OnClientClick='<%#"javascript:window.open(&#39;ImageHandler.ashx?ImID="+ Eval("Ifile") + "&#39;)" %>' />