Issue modifying control from static method
<p>There are a few questions on here that are similar, but they didn't work for me.</p>

<p>I have a custom drop down list on a page, the page name is <code>WebForm1</code>. On <code>WebForm1</code> I have an assembly reference to it: <code>&lt;%@ Register Assembly="GroupDropDownList" Namespace="GroupDropDownList" TagPrefix="cc1" %&gt;</code> </p>

<p>I then have a static method like this:</p>

<pre><code>    public static void Populate_Country_DDL(System.Web.UI.Page page)
        {
            GroupDropDownList
                .GroupDropDownList ddlCountry =
 ((GroupDropDownList.GroupDropDownList)page.FindControl("ddlCountry"));

            using (DataContext db = new DataContext())
            {
                var country = db.Countries.OrderBy(x =&gt; x.Text);

                ddlCountry.DataSource = country; //Error here
</code></pre>

<p>On <code>WebForm1</code> i'm trying to access the static method like this:</p>

<pre><code>Utility.Populate_Country_DDL(this.Page);
</code></pre>

<p>The problem is that I'm getting an "Object reference not set to an instance of an object" error. I put a using statement in my utility class for <code>GroupDropDownList</code></p>

<p><code>GroupDropDownList</code> simply allows me to put option groups inside a drop down list.</p>

<p><strong>Update:</strong> To fix the problem I modified my utility method to take a <code>ContentPlaceHolder</code> instead of <code>Page</code> class, and then in my calling method I found the ContentPlaceHolder within the current pages MasterPage like this:</p>

<pre><code>Utility.Populate_Country_DDL(
                (ContentPlaceHolder)this.Master
                .FindControl("ContentPlaceHolder1"));
</code></pre>
