Hi all, I am looking to set a OnClick event for GridHyperLinkColumn and I don't want to use any AJAX calls. The event should be handled in server side. So is there a way to do this?
One way would be by using AJAX . Can we achieve this in any other way?
I'm afraid there is no other way since the GridHyperLinkColumn is rendering HyperLink control which does not postback and thus it does not have Click event. If you want to have a client-side click event you could access the HyperLink in the code behind and attach its onclick event as follows:
If you want to have server-side Click event you should use GridTemplateColumn with LinkButton inside its ItemTemplate or your could use GridButtonColumn with ButtonType set to LinkButton.