The text changed event and the queystring and two separate entry points to your code. If you want them both to work then create a function that does all of the work and have it accept an id as a parameter
private void DoMySearch(string id)
{
}
Then call that function from the text change event for that scenario, and also the page load event for that scenario
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack && !string.IsNullOrWhiteSpace(Request.QueryString["StaffID"]))
{
DoMySearch(Request.QueryString["StaffID"]);
StaffID.Text = Request.QueryString["StaffID"];
}
}
protected void StaffID_TextChanged(object sender, EventArgs e)
{
DoMySearch(StaffID.Text);
}