I've been trying, unsuccessfully, to create a custom server control that can allow me to take advantage of ViewState and AutoPostBack. What is tricky is that my control is a combination of HTML and JavaScript. Here is a good example of what the rendered output would be (I'm using a JS library as well, hence the abbreviated example):
<input type="text" id="txt" />
<script>
$(function() {
$("#txt").TurnMeIntoDatePicker({
value: new Date(1950,1,1)
});
});
</script>
In this example the "id" of the input and the "value" of the JS function would need to be exposed as parameters (and their values maintained after postbacks via ViewState). Every example I've seen allows you to assign parameters to the input element, but not to some custom string of JS. I would also love to see how you could add an AutoPostBack function, but would just be gravy!