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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -