locked
ComboBox - ComboBox1There was an error rendering the control. RRS feed

  • Question

  • User1344226387 posted

    Hello,

    I am using the ComboBox from the Ajax Toolkit in VS2013. However I get the following error:

    ComboBox - ComboBox1

    There was an error rendering the control. Value cannot be null. Parameter name: Stream

    When I try running it the dropdown appears outside of the textbox. Can anyone tell me what the problem is. Trioed changing the Render mode to Block , but this does not resolve the issue. Call ComboBox definition below:   

    <cc1:ComboBox ID="ComboBox1" runat="server" OnSelectedIndexChanged="ComboBox1_SelectedIndexChanged2" RenderMode="Block" style="position:absolute"> </cc1:ComboBox>

    regards

    Pat

         
            <!--?xml:namespace prefix = "cc1" /--><cc1:combobox id="ComboBox1" style=";" rendermode="Block" onselectedindexchanged="ComboBox1_SelectedIndexChanged2" runat="server">
            </cc1:combobox>
            
       

                   
                    
            <!--?xml:namespace prefix = "cc1" /--><cc1:combobox id="ComboBox1" style=";" rendermode="Block" onselectedindexchanged="ComboBox1_SelectedIndexChanged2" runat="server">
            </cc1:combobox>
            
       <!--?xml:namespace prefix = "cc1" /--><cc1:combobox id="ComboBox1" style=";" rendermode="Block" onselectedindexchanged="ComboBox1_SelectedIndexChanged2" runat="server">
            </cc1:combobox>
            
        
            <!--?xml:namespace prefix = "cc1" /--><cc1:combobox id="ComboBox1" style=";" rendermode="Block" onselectedindexchanged="ComboBox1_SelectedIndexChanged2" runat="server">
            </cc1:combobox>
            
       

    Sunday, May 17, 2015 1:54 PM

All replies

  • User2103319870 posted

    If you have any scriptManager in your page, then set its ScriptMode to Release

     <asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release">
            </asp:ScriptManager>

    Sunday, May 17, 2015 2:18 PM
  • User-409062988 posted

    I see the same thing, AJAX Kit 15.1 and VS2010

    Have not found a work around yet.

    Other controls are working.

    I think this is a bug in 15.1

    Any suggestions???

    Sunday, May 17, 2015 3:34 PM
  • User1344226387 posted

    Thanks a2h,

    I added ScriptMode="Release" but it seems to have made no difference. I am also using AjaxControlToolkit 15.1.  Any other suggestions

    regards

    Pat

            <!--?xml:namespace prefix = "asp" /--><asp:scriptmanager id="ScriptManager1" scriptmode="Release" runat="server">         </asp:scriptmanager>
            
           

    Monday, May 18, 2015 3:28 PM
  • User1644755831 posted

    Hello pclarke,

    I tried this with VS2013 and AjaxControlToolkit 15.1. but it works fine with me. regardless of  ScriptMode. visual studio's version should not have any effect on this I believe.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm31.aspx.cs" Inherits="WebFormsIdentity.WebForm31" %>
    
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
      <title></title>
    </head>
    <body>
      <form id="form1" runat="server">
        <div>
          <asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release"></asp:ScriptManager>
          <cc1:ComboBox ID="ComboBox1" 
            runat="server" 
            OnSelectedIndexChanged="ComboBox1_SelectedIndexChanged"
            RenderMode="Block"></cc1:ComboBox>
        </div>
      </form>
    </body>
    </html>
    

    Can you try to create a new project and do this like I have done.

    1. drag and drop both script manager and combobox to the form and then run.

    Hope this helps.

    With Regards,

    Krunal Parekh

    Tuesday, May 19, 2015 4:19 AM
  • User1344226387 posted

    Hello Krunal,

    I have the same code as your example

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="DCRulesWeb01.WebForm1" EnableSessionState="True" %>

    <%@ Register Assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

    I decided to remove AjaxControlToolkit and re-install it via NuGet.  So I installed AjaxMin, HTMLAgilityPack, WindowAzure.Storage which are dependancies of AjaxControlToolkit and then I installed AjaxlControlToolkit (the one which states it has 40 controls ). However after doing this when I go to explorer and look at references I can only see a reference to AjaxMin and no reference to AjaxControlToolkit.

    I removed the comboBox and the ScriptManager from my webForm1 page and tried to add them again. I was able to see and add the scriptmanager. However whilst I could see ComboBox on the toolbar under heading AjaxControlToolkit15.1 I could not add it to the webform. (It drags across but does not add)

    I am also seeing the following error:

     Error 1 The type or namespace name 'AjaxControlToolkit' could not be found in the global namespace (are you missing an assembly reference?) C:\Users\User\Documents\Visual Studio 2013\Projects\DCRulesWeb01\DCRulesWeb01\WebUserControl1.ascx.designer.cs 22 27 DCRulesWeb01

    So now I am really stuffed. I'm not sure where I have gone wrong and not sure how I can fix it. I would really appreciate it if someone could give me some details instructions how I might correct this problem. I am relatively new to c# and asp.net and web development , so the problem is most likely of my own doing

    regards

    Pat

    Tuesday, May 19, 2015 5:38 PM
  • User1644755831 posted

    Hello pclarke,

    Did you install the toolkit using msi installer from here? https://ajaxcontroltoolkit.codeplex.com/ Seems like your references are wrong when you add AjaxControlToolkit it will add below reference

    As for Ajax Min it seems it is a reference to http://ajaxmin.codeplex.com/ Ajax Minifier its enables you to improve the performance of your web applications by reducing the size of your Cascading Style Sheet and JavaScript files. As I suggested Create new project in which just AjaxControlToolkit reference is needed for me I have no need of AjaxMin, HTMLAgilityPack, WindowAzure.Storage references while using AjaxControlToolkit.

    Here is a working Demo (2051106.zip)

    https://onedrive.live.com/redir?resid=27fab974ac31445f%21143

    Hope this helps.

    With Regards,

    Krunal Parekh

    Tuesday, May 19, 2015 10:01 PM
  • User1344226387 posted

    Hi Krunal,

    still no joy!!  I installed ajaxcontroltoolkit from codeplex and now have AjaxControlToolkit showing up under references. (c:\users\user\AppData\Local\Microsoft\VisualStudio\11.0\Extensions\teptbuom.2gk\AjaxControlToolkit.dll) However still getting the very same error with a new application after dragging scriptmanager and combobox to new page.

    ComboBox - ComboBox1

    there was an error rendering the control.

    Value cannot be null. Parameter name: stream

     

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

    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>


    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">

       <title></title>

    </head>

    <body>

       <form id="form1" runat="server">

       <div>

       </div>

       <asp:ScriptManager ID="ScriptManager1" runat="server">

       </asp:ScriptManager>

       <cc1:ComboBox ID="ComboBox1" runat="server" RenderMode="Block">

      </cc1:ComboBox>

       </form>

    </body>

    </html>

    Wednesday, May 20, 2015 5:10 PM
  • User1644755831 posted

    Hello pclarke,

    You could post your question here on AjaxControlToolKit Issues. 

    https://ajaxcontroltoolkit.codeplex.com/workitem/list/basic

    You are likely to get more response from there.

    Hope this helps.

    With Regards,

    Krunal Parekh

    Wednesday, May 20, 2015 9:58 PM