asp.net - Change onclick of an image -
i have html img
<img id="btnviewspec" alt="view spec sheet"src="/images/viewspec.jpg" style="cursor: pointer;" />
i need alter onclick target different aspx pages based on what's read database. like:
if dbread("keywords").tostring.contains("glove") me.btnviewspec.attributes.add("onclick", ("window.open('/specsheet/displaypdf.aspx?pa=/specsheet/glovespec.aspx?pid=" & intproductid & "','wnemailinfo', 'menubar=no,width=820,height=500,toolbar=no,scrollbars=yes,status=yes')")) else me.btnviewspec.attributes.add("onclick", ("window.open('/specsheet/displaypdf.aspx?pa=/specsheet/clothingspec.aspx?pid=" & intproductid & "','wnemailinfo', 'menubar=no,width=820,height=500,toolbar=no,scrollbars=yes,status=yes')")) end if
problem can't code behind recognize image. tried register in designer code protected withevents btnviewspec htmlimage
no luck. guess don't understand issue or gets registered in designer code. thanks
add runat="server"
image tag , have access control
Comments
Post a Comment