I have table in which is created dynamically, the table has a drop down list. When I click the drop down list it posts back and the focus is set back to the top of the page. How can I set the focus to the drop down list that was clicked.
I tried adding the attributes onclick and make a sub called ddl_click but when ever I click the drop down list I get an error stating
"Microsoft JScript runtime error: 'ddl_Click' is undefined'
This is my code where I dynamically create the DDL
ddlrequest1.ID = "ddlrequest1" + Count.ToString
ddlrequest1.Width = Unit.Pixel(130)
ddlrequest1.Enabled = True
ddlrequest1.Items.Add("Select Class")
ddlrequest1.Attributes.Add("AutoPostBack", "true")
ddlrequest1.Attributes.Add("runat", "server")
ddlrequest1.Attributes("onClick") = "ddl_Click"
Request.Controls.Add(ddlrequest1)