Dim theme As Stringtheme = DropDownList1.SelectedValueDataList1.ItemTemplate = Page.LoadTemplate(theme & ".ascx") ---CoolDataList1.DataSource = DSDataList1.DataBind()
Private Sub SetFocus(ByVal controlToFocus As Control)Dim scriptFunction As New StringBuilderDim scriptClientId As StringscriptClientId = controlToFocus.ClientIDscriptFunction.Append("<script language='javascript'>")scriptFunction.Append("document.getElementById('" & scriptClientId & "').focus();")scriptFunction.Append("</script>")RegisterStartupScript("focus", scriptFunction.ToString())End SubPrivate Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadIf (Page.IsPostBack = False) ThenSetFocus(TextBox1)End IfEnd Sub