I have been struggling with something at work for a few days now and that is setting the default text field on the login page of the miiCard website.
So the JQuery was quite simply, one line.
$(‘#<%= ((TextBox)Login1.FindControl("UserName")).ClientID %>’).focus();
Which generates the correct code replacing thepart with the client ID that the server had generated.
I haven’t tested this but the same should be easy to do if you’re not using JQuery too.
document.getElementById(‘<%= ((TextBox)Login1.FindControl("UserName")).ClientID %>’).focus()
Hope this of interest to someone.