Skip to content Skip to sidebar Skip to footer

Onserverclick And Onclick Not Work

From my code behind im load data in html list (table): ASP

Solution 1:

It does not work that way. If you place control on the aspx form with runat="server" that control is processed on the server and output html is returned to the client with proper javascript function (if you specify event like for example OnClick) that posts the form back. If you generate string like you do and assign it to literal it is render 'as it is' as server-side processing already has taken place so runat="server" has no meaning there - it is just a string.

To achieve what you want I suggest using Repeater control with LinkButton control. There is a lot of examples/tutorial on the web how to do it.

Solution 2:

I think your problem can be solved using LinkButton or Hyperlink instead of anchor tag.

Post a Comment for "Onserverclick And Onclick Not Work"