[SOLVED] How to set control focus in a ASCX user control ?

Issue

How to set control focus on Asp.Net user control (ascx file) ?

Solution

Expose a property / control from user control.
Access it on parent page and set call .Focus() function.

e.g.

((TextBox)userControl.FindControl("TextBox1")).Focus();

Answered By – Imran Rizvi

Answer Checked By – David Goodson (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *