I have a user control that creates a jQuery DatePicker (standard one in the UI). This user control is called twice by my page (date from/to) so I have dynamic ID's for my inputs/controls/buttons/what-not. I need to somehow set either a hidden input or use a webmethod somehow to set a variable on the user control so the search function can retreive the date.
Does this make sense?
Thanks, Keith
A little more clarification on your question might be helpful.
However, when you get ASP.NET and jQuery together, ASP.NET's penchant for creating complex ClientID parameters can certainly rear it's ugly head.
I've found it's useful to have a div or span with a specific class name in the user control, then have predictable markup from that point onward.
For example:
<span class="DatePickerUserControl">
<div>...date controls</div>
<input type="hidden" class="DatePickerHidden" ... />
</span>
Then in your jQuery:
$(".DatePickerUserControl").each(function(e) {
$("input.DatePickerHidden", this).each(function(e) {
// Here "this" refers to the hidden field for the particular date picker
});
});