none
Visual Studio 2015 Community Missing Webform Controls From Toolbox

    Question

  • Hello,

    I am running VS 2015 Community v. 14.0.25431 update 3 and .net 4.6.01055 on a windows 7 pc. Upon working on a asp.net project the only controls available to me in my toolbox are html controls. If I select "show all" from the toolbox context menu, the missing controls show up but are disabled. I have tried creating projects in multiple framework versions including 4, 4.5 and 4.6. VS 2010 professional is also running on my pc, but does not have this issue. Does anyone have an idea on this?

    Thanks

    Tuesday, November 29, 2016 4:49 PM

Answers

  • Hi KPChow,

    Could you please right click the 'Default.aspx' file and choose 'Open With...', check the default program that you used to open this file. If I tried to choose 'HTML (Web Forms) Editor' as the default, then the toolbox looks like yours. If you select 'Web Forms Editor' as default, you should see those missing controls.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 07, 2016 9:00 AM
    Moderator

All replies

  • Hi KPChow,

    Welcome to the MSDN forum.

    Did you create the C#-ASP.NET Web Application (.NET Framework)-Web Forms, right? I tried it on my side, if I double click the xxx.aspx and check the toolbox, there are many controls like the following screenshot, if I double click other file type, the Toolbox maybe empty or little controls. The controls default display in Toolbox is depend on your current open file, please check your current open file or share a screenshot of your current screen.

    If you already open the right file type, but those default controls still cannot appear, please have a try with the following to troubleshot this issue:

    1. Right click in the Toolbox and choose ‘Rest Toolbox’ or ‘Choose Items’
    2. Check if your application is running or debug, then stop it then the toolbar items will become enable
    3. Restart the computer and reopen VS
    4. Go to control Panel—Programs and Features and right click the VS community 2015 item and Change-Repair

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 30, 2016 8:05 AM
    Moderator
  • Hi Sara,

    Thanks for replying to my question. I am editing an asp.net webform (Default.aspx in my example). The only controls available to me are the HTML controls and my application is not running/debugging.

    I would have included screenshots, but my account is not yet verified.

    Curiously enough, I can enter asp controls into my webform's source.

    <asp:ButtonID="btnSearch"runat="server"Text="Search"/>

    Even though this control will not show in the webform designer, it will show up when I run my application.

    I have tried resetting the toolbox, repairing/reinstalling vs2015 and my pc has been restarted many times since I noticed this issue. I have tried selecting frameworks 4, 4.5, 4.6 and 4.6.1.  

    If I select "show all" from the context menu of my toolbox, the missing items will show up, but are disabled.

    Wednesday, November 30, 2016 5:46 PM
  • Hi KPChow,

    Thank you for your update.

    >> I am editing an asp.net webform (Default.aspx in my example).

    Does this project is new created? If not, please have a test with a new web form project. If it also not works, please run the command: devenv /safemode in the elevated command prompt to run the VS using the safe mode, it can help us to excludes the possibility of the installed extensions.

    >>I would have included screenshots, but my account is not yet verified.

    Please ask for a requirement in here to verify your account, then you can share the screenshots in here, thank you for your understanding.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 01, 2016 9:47 AM
    Moderator
  • Hi Sara,

    Thank you for your assistance.

    My project is new and my issue persists in safemode run as administrator. 

    Even though I do not have access to asp controls in my toolbox I can manually code them on to my page source.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Test_WebApplication_DN46.Default" %>

    <!DOCTYPE html>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:textbox ID="txtShowMe" runat="server" />
            <asp:button ID="btnShowMe" runat="server" Text="Show Me" onclick="btnShowMe_Click" />
        </div>
        </form>
    </body>
    </html>

    There is another peculiar symptom. I could not get to the code behind file "Default.aspx.cs" by right clicking on the page designer. I had to go to the solution explorer to access my code behind file. Also, intellisense could not find txtShowMe and I could not reference it without getting a compile error.

    I put some code in the Page_Load event to list the controls on my page.

            protected void Page_Load(object sender, EventArgs e)
            {
                foreach (Control c in this.Controls)
                {
                    if (c.ID != null) Response.Write(c.ID + " * " + c.GetType() + "<br />");
                    foreach (Control c2 in c.Controls)
                    {
                        if (c2.ID != null) Response.Write("-" + c2.ID + " * " + c2.GetType() + "<br />");
                    }
                }
            }

    Here are the results:

    form1 * System.Web.UI.HtmlControls.HtmlForm
    -txtShowMe * System.Web.UI.WebControls.TextBox
    -btnShowMe * System.Web.UI.WebControls.Button

    I added an event to my button to write the text property of my text box. To get that to work I had to create my onclick event as follows:

            protected void btnShowMe_Click(object sender, EventArgs e)
            {
                //Response.Write(txtShowMe.text); Will not compile.
                //Response.Write(form1.txtShowMe.text); Will not compile.
                TextBox tb = null;
                foreach (Control c in this.Controls)
                {
                    foreach (Control c2 in c.Controls)
                    {
                        if (c2.GetType() == typeof(TextBox) && c2.ID == "txtShowMe")
                        {
                            tb = c2 as TextBox;
                        }
                    }
                }
                try
                {
                    Response.Write(tb.Text); //This works.
                }
                catch (Exception ex)
                {
                    Response.Write(ex);
                }
            }

    The TextBox control "tb" has to be instantiated as a late bound control as txtShowMe could not be found at compile time. 

    Thanks again for helping me with this.

    Thursday, December 01, 2016 5:13 PM
  • Hi KPChow,

    Have you tried to right click in the Toolbox and select 'Choose Items...', then checked the checkbox of those common components under .NET Framework, or right click in the Toolbox and select 'Add Tab', then select 'Choose Items...' like the following screenshot:


    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Saturday, December 03, 2016 11:08 AM
    Moderator
  • Hi Sara,

    My web UI controls are already selected. Here is a screenshot showing the only items in my toolbox (HTML controls).

    Thanks

    Monday, December 05, 2016 3:15 PM
  • Hi KPChow,

    Could you please go to Tools-Import and Export Settings… and select ‘Reset all settings’, then save your current settings, then click ‘Finish’ button to reset the customized setting to the default, it can help us to excludes the customized setting caused this issue.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 06, 2016 1:58 AM
    Moderator
  • Hi Sara,

    I got this error:

    Also, I noticed the "Error Creating Control - txtShowMe" message in my webform today. This was showing as soon as I opened VS today, before I reset my settings.

    I did not see this yesterday when I closed VS. This error went away after I restarted VS after resetting all settings.

    Thanks

    • Marked as answer by KPChow Thursday, December 08, 2016 3:04 PM
    • Unmarked as answer by KPChow Thursday, December 08, 2016 3:04 PM
    Tuesday, December 06, 2016 3:17 PM
  • Hi KPChow,

    Could you please right click the 'Default.aspx' file and choose 'Open With...', check the default program that you used to open this file. If I tried to choose 'HTML (Web Forms) Editor' as the default, then the toolbox looks like yours. If you select 'Web Forms Editor' as default, you should see those missing controls.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 07, 2016 9:00 AM
    Moderator
  • Thank you so much Sara! Your suggestion fixed my problem!

    Cheers

    Wednesday, December 07, 2016 3:11 PM
  • Hi KPChow,

    I'm so glad to hear that your issue is solved and thank you for your sharing.

    BTW, if you think my reply is helpful, please mark it as answer, that will help other community members who have the same or similar issue to easier search this solution, thank you for your support.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by KPChow Thursday, December 08, 2016 3:03 PM
    • Unmarked as answer by KPChow Thursday, December 08, 2016 3:04 PM
    Thursday, December 08, 2016 1:14 AM
    Moderator