locked
ajax tookit cobobox error rendering RRS feed

  • Question

  • User-1171858434 posted

    Hello all

    Any help appreciated

    I am using vs2010, and ajaxcontroltoolkit15.1

    I add combobox to page bu in design mode display error 

    ajax tookit cobobox error

    there was an error rendering the control

    Parameter name stream value cannot be null

    and in run time it does not work.

    the code is

    <cc1:ComboBox ID="ComboBox1" runat="server" AutoCompleteMode="Suggest" 
                        DataSourceID="sqdsField" DataTextField="FieldName" DataValueField="FieldSerial" 
                        MaxLength="0" style="display: inline;">
    </cc1:ComboBox>

    Best regards

    Sunday, September 25, 2016 6:53 PM

Answers

  • User-707554951 posted

    From you description, I use combobox in my application, it rend correctly,
    1. Add the following code to your page

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

    2. in the web configure, I set tagPrefix  to cc1:

    2.	in the web configure, I set tagPrefix  to cc1:
    <system.web>   
        <pages>
          <controls>
            <add tagPrefix="cc1" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
          </controls>
    </pages>
      </system.web>
    


    3. page’s html is the code below:

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
        <cc1:ComboBox ID="ComboBox1" runat="server" AutoCompleteMode="Suggest" 
                        DataSourceID="SqlDataSource1" DataTextField="ProductName" DataValueField="ProductID" 
                        MaxLength="0" style="display: inline;">
    </cc1:ComboBox>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT top 5 [ProductID], [ProductName] FROM [Alphabetical list of products]"></asp:SqlDataSource>
              </div>
    

    The screenshot like below:

    So, I suggest you could to check you SqlDataSource, you also could provide code about your SqlDataSource so that we could find the reason and solution timely.
    Hope this can help you. If you have any question and confusion about the problem. Please don't hesitate to let me know.
    Best regards
    Cathy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 26, 2016 4:33 AM
  • User-1171858434 posted

    Dear Cathy

    Thank you for nice reply.

    All the commands you mentioned I have done. 

    Anywhere in any page I add combo box before i define ane item it show the error here is the immage of the combobox.

    combo box error

    and in run time  dropdown appears outside of the textbox. I followed this link sugestion

    http://forums.asp.net/t/2051106.aspx?ComboBox+ComboBox1There+was+an+error+rendering+the+control+

    the page code is

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

    <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">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <cc1:ComboBox runat="server">
    <asp:ListItem Value="1">test</asp:ListItem>
    <asp:ListItem Value="2">test</asp:ListItem>
    </cc1:ComboBox>
    </ContentTemplate>
    </asp:UpdatePanel>
    </div>
    </form>
    </body>
    </html>

    and webconfig include code

     <pages buffer="true" masterPageFile="~/PortalLecturers/MasterPage.master" enableEventValidation="false">
          
          <controls>
            <add tagPrefix="cc1" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
            
          </controls>
        </pages>

    Im prety new in asp.net. Should i install ajaxtoolkit again?

    Thank you for helping

    best regards hriaz

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 26, 2016 10:19 AM
  • User-1171858434 posted

    I think it was compatibility issue, i removed toolkit ver15 and installed toolkit 4 now it works.

    thank you all

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 26, 2016 11:54 AM

All replies

  • User-707554951 posted

    From you description, I use combobox in my application, it rend correctly,
    1. Add the following code to your page

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

    2. in the web configure, I set tagPrefix  to cc1:

    2.	in the web configure, I set tagPrefix  to cc1:
    <system.web>   
        <pages>
          <controls>
            <add tagPrefix="cc1" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
          </controls>
    </pages>
      </system.web>
    


    3. page’s html is the code below:

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
        <cc1:ComboBox ID="ComboBox1" runat="server" AutoCompleteMode="Suggest" 
                        DataSourceID="SqlDataSource1" DataTextField="ProductName" DataValueField="ProductID" 
                        MaxLength="0" style="display: inline;">
    </cc1:ComboBox>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT top 5 [ProductID], [ProductName] FROM [Alphabetical list of products]"></asp:SqlDataSource>
              </div>
    

    The screenshot like below:

    So, I suggest you could to check you SqlDataSource, you also could provide code about your SqlDataSource so that we could find the reason and solution timely.
    Hope this can help you. If you have any question and confusion about the problem. Please don't hesitate to let me know.
    Best regards
    Cathy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 26, 2016 4:33 AM
  • User-1171858434 posted

    Dear Cathy

    Thank you for nice reply.

    All the commands you mentioned I have done. 

    Anywhere in any page I add combo box before i define ane item it show the error here is the immage of the combobox.

    combo box error

    and in run time  dropdown appears outside of the textbox. I followed this link sugestion

    http://forums.asp.net/t/2051106.aspx?ComboBox+ComboBox1There+was+an+error+rendering+the+control+

    the page code is

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

    <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">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <cc1:ComboBox runat="server">
    <asp:ListItem Value="1">test</asp:ListItem>
    <asp:ListItem Value="2">test</asp:ListItem>
    </cc1:ComboBox>
    </ContentTemplate>
    </asp:UpdatePanel>
    </div>
    </form>
    </body>
    </html>

    and webconfig include code

     <pages buffer="true" masterPageFile="~/PortalLecturers/MasterPage.master" enableEventValidation="false">
          
          <controls>
            <add tagPrefix="cc1" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
            
          </controls>
        </pages>

    Im prety new in asp.net. Should i install ajaxtoolkit again?

    Thank you for helping

    best regards hriaz

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 26, 2016 10:19 AM
  • User-1171858434 posted

    I think it was compatibility issue, i removed toolkit ver15 and installed toolkit 4 now it works.

    thank you all

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 26, 2016 11:54 AM