title: Weird trouble - cannot assign javascript to linkbutton
body: <p>I seem to manage the same task many times beforehand; but currently I got thoroughly stuck at the simplest thing and it have made mequite irritated</p>
  
  <p>I need to assign javascript to ASP.Net linkbutton (or hyperlink, does not matter)
  What seems to be easier? </p>
  
  <p>Billion times I did it with  code like like that</p>
  
  <pre><code>        //lbHeader.Attributes.Add("onclick",
          //    string.Format("ToggleSelectionPopup('{0}');return false;", panelContainer.ClientID));
  </code></pre>
  
  <p>But it doesn't work. HTML I get contains javascript:__doPostback (blahblahblah) and ignores my client "onclick" function. Instead it the page goes to postback when I click the button (despite "onclick" function attaches properly in the "view page source" HTML</p>
  
  <p>I tried to apply some tricks and approaches like following</p>
  
  <p>1) to replace LinkButton with Hyperlink - effect still same, page forwards to "NavigateURL" when I click the href. </p>
  
  <p>2) to assign "OnClientClick" properety in the declarative layout - the same effect, page goes to postback anyway and ignores "onclick"</p>
  
  <p>3) to assign "javascript:ToggleSelectionPopup(blahblahblah)" as NavigateURL of the hyperlink and as PostBackURL of the linkButton. Doesn't work either</p>
  
  <p>Neither of tricks helped. What do I do wrong, any ideas?</p>
  
  <p>I just need to get rid of shitty server performance of that control, but how can I do it? Certainly, I can make LiteralControl with " manually, but I'd like not to use such a rough approach.</p>
  
  <p>Help highly appreciated</p>