title: Call Javascript onchange event by programmatically changing textbox value
body: <p>the problem I'm facing is this:</p>
  
  <ul>
  <li>I have a textbox for a date range along side a calendar control.  </li>
  <li>When the user selects a date from the calendar, it fills that date into the textbox</li>
  <li>When this happens I want to fire a javascript function, however, the 'onchange' event doesn't seem to happen.</li>
  </ul>
  
  <p>I'd ideally like to be able to add the event as an attribute to the textbox, something like:</p>
  
  <pre><code>txtCreateDate.Attributes.Add("onchange", string.Format("JSfunction({0},'{1}');", arg1, arg2));
  </code></pre>
  
  <p>more info:
  The date is entered into the textbox in c#.  The calendar control has an eventhandler on the page.  When a date is selected, the eventhandler puts the date into the textbox.  I have tried setting the focus to the textbox at this point, then putting an onBlur attribute on the textbox, but the textbox never seems to get focus.</p>
  
  <p>I suppose I could directly call the javascript function at this point doing ClientScript.RegisterClientScriptBlock or something like that, but that seems sloppy and never works like I want it to.</p>