Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8688019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:15:28+00:00 2026-06-12T23:15:28+00:00

I have an issue using Ajax Control Toolkit ComboBox. Here is my test markup

  • 0

I have an issue using Ajax Control Toolkit ComboBox.
Here is my test markup page:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<div>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" />
<% if (CheckBox1.Checked)
{ %><asp:ComboBox ID="ComboBox1" runat="server">
</asp:ComboBox>

<% } %>
</div>
</form>
</body>
</html>

After CheckBox1 rises PostBack I get a NullReferenceException in the method AjaxControlToolKit.ComboBox.System.Web.UI.IPostBackDataHandler.LoadPostData(stringpostDataKey, System.Collections.Specialized.Name.ValueCollection postCollection) and Visual Web Developer 2010 Express asks me the path of the Class ComboBox.cs that I don’t have.

Without <% if { } %> the ComboBox works fine.

Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:15:29+00:00Added an answer on June 12, 2026 at 11:15 pm

    The reason is that when checkbox becomes checked and postback arised, combobox control expects that in posted from client data collection exists data for his state hidden field control.

    There are two workarounds available: the first on suggested in this answer: https://stackoverflow.com/a/12364475/360171
    And the second one (that indeed more correct) is don’t use <% ... %> expressions to hide server controls. Use ComboBox1.Visible = CheckBox1.Checked in the Page_Load method instead.

    Moreover, try to avoid <% .. %> expressions in markup to perform any manipulations with server controls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue using jquerys selectors when it comes to a page I
I have an issue going on here. I am using PHP to get values
I have an issue retrieving ajax data using jquery 1.3.2 / 1.4.2: It works
I have been using the same Ajax Combobox everywhere in my project but as
I have been using DotNetOpenAuth's OpenIdTextBox control on our login page. We used VS
I have an Ajax control that is loaded into a Yahoo popup using jQuery.
I am using asp.net 3.5 with the ajax toolkit. The problem: I have a
I'm using the AutoComplete control from the ASP.NET AJAX Control Toolkit and I'm experiencing
I am using ajax colorpickerextender control for color selection. For TargetControlID, I have used
I have issue with sending AJAX body request using jQuery CORS with custom Content-type.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.