views:

81

answers:

1

I have a LinkButton that I need to perform a click on to cause a postback. The actual link target is:

javascript:__doPostBack('ctl00$c1$btnRefreshGrid','');

Clicking the link does perform the postback, as verified by a breakpoint in the code-behind. Also pasting javascript:__doPostBack('ctl00$c1$btnRefreshGrid','') in the address bar of the browser works with the same effect.

I've tried the following with no effect at all:

__doPostBack('ctl00$c1$btnRefreshGrid','');    
$('#ctl00$c1$btnRefreshGrid').click();
$('#ctl00$c1$btnRefreshGrid').trigger('click');
eval($('#ctl00$c1$btnRefreshGrid').attr("href"));

I've tried using both <%= btnRefreshGrid.UniqueID %> and <%= btnRefreshGrid.ClientID %> to generate the selector.

A: 
$("#<%= btnRefreshGrid.ClientID %>").click();

Should work...

Hope it helps!!!

Carlos Mendible
For some reason it doesn't. I think it's a Firefox bug - there are some articles online about it.
Mark Richman