C# - Can't access main page's dropdown list from private class RRS feed

  • Question

  • So I have a default.aspx page and a default.aspx.cs to go with it.

    In the default.aspx I have a "ddlTest" with "runat='server'" which I can access inside of the "Page_Load" but I cannot seem to access it from a private class I generated.

    I tried the following but it did not work:

     Page page = HttpContext.Current.CurrentHandler as Page;
                _Default page134 = new _Default();

    I still could not find the desired dropdown list.

    Ideally I would like to be able to reset the dropdown's selected index on the default.aspx page from the private class in the default.aspx.cs file.

    Any help would be greatly appreviated.

    • Moved by CoolDadTx Tuesday, July 11, 2017 7:09 PM ASP.NET related
    Tuesday, July 11, 2017 2:19 PM

All replies