c# - asp.net Make a listView row clickable without a button -


i want make listview row clickable without using button. listview filled data out of database putting onclick methode directly on tr isnt option.

i found tread: http://forums.asp.net/t/1419161.aspx

but error: " registerforeventvalidation can called during render()" @ line:

     string script = this.clientscript.getpostbackclienthyperlink(btn, "", true); 

this fixable setting " enableeventvalidation="false" " @ @page directive.

now question:

  • am doing wrong?
  • is bad thing turn eventvalidation off?
  • is there better way of doing this? if how?

i prefer listview if there better way involves other grid control hear that.

i making in asp.net vb.net c# example fine.

thanks!

you can database. in example below clicking on row call javascript function called evalitem, , pass "publisher" field data item row bound listview.

 <itemtemplate>     <tr class="clsgrouprowselectable" onclick='evalitem(&#39;<%# eval("publisher").tostring() %>&#39;);'>        <td><%# eval("number") %>' /></td>     </tr>  </itemtemplate> 

Comments

Popular posts from this blog

Java 8 + Maven Javadoc plugin: Error fetching URL -

css - SVG using textPath a symbol not rendering in Firefox -

order - Notification for user in user account opencart -