Q:

Use of unassigned local variable 'TargetControl'

Showing error in line 3.
Code in Below
if (this.Page.Master != null)
{
    Control TargetControl;
    if (this.Page.Master.FindControl(this.TargetControlID) != null)
    {
        return this.Page.Master.FindControl(this.TargetControlID);
    }
    return TargetControl;
}

A:

Change your code to just this:
return Page.Master.FindControl(TargetControlID);

This will either return null if its not found or it'll return the control.

