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 6630681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:26:24+00:00 2026-05-25T22:26:24+00:00

I have an Asp.net page with 3 combobox and 1 button. The first combobox

  • 0

I have an Asp.net page with 3 combobox and 1 button. The first combobox selection will affect the other 2 combobox datasource. I’m setting the datasource for the other combobox using a callback function.
After the user choose from all the combobox, the user click the button and a postback is generate.
My Problem is that the server side code, is not aware of the selections made in the page,
if i try to get the value from the combobox I get null allways.
looking for a solution.

Thank you.

Code

Code of aspx
<script type="text/javascript">
    // <![CDATA[
        function OnProductChange(cb_Products) {
            cb_Packing.PerformCallback(cb_Products.GetValue().toString());
            cb_ProductionSite.PerformCallback(cb_Products.GetValue().toString());
        }
        function OnPackChange(cb_Products) {
            ASPxComboBox1.PerformCallback(cb_Packing.GetValue().toString());
        }`enter code here`
        function OnFactoryChange(cb_Products) {
            cb_ProductionSite.PerformCallback();
        }
    // ]]> 
    </script>

<PanelCollection>
            <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                <dx:ASPxLabel ID="ASPxLabel1" runat="server" Font-Bold="True" Font-Names="Snap ITC"
                    Font-Size="Medium" Font-Underline="True" ForeColor="#333333" Text="Production Form (DEMO)">
                </dx:ASPxLabel>
                <br />
                <br />
                <dx:ASPxLabel ID="ASPxLabel2" runat="server" Font-Names="Berlin Sans FB Demi" Font-Size="Medium"
                    Text="Select Product" ForeColor="#FF3300">
                </dx:ASPxLabel>
                <dx:ASPxComboBox ID="cb_Products" runat="server" ValueType="System.String" Font-Names="Berlin Sans FB Demi"
                    DataSourceID="EntityDataSource1" Spacing="3" TextField="PC_Name" EnableSynchronization="False"
                    ValueField="PCID" ClientIDMode="Static" DropDownStyle="DropDownList">
                    <Columns>
                        <dx:ListBoxColumn Caption="Product's name" FieldName="PCID" Visible="false" />
                        <dx:ListBoxColumn Caption="Product's name" FieldName="PC_Name" />
                    </Columns>
                    <ClientSideEvents SelectedIndexChanged=" function(s,e) { OnProductChange(s); }" />
                </dx:ASPxComboBox>
                <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=TrackQREntities"
                    DefaultContainerName="TrackQREntities" EnableFlattening="False" EntitySetName="TrackQR_ProductsCatalog"
                    Select="it.[PC_Name], it.[PCID]" Where="it.[ClientID] == 11">
                </asp:EntityDataSource>
                <br />
                <br />
                <dx:ASPxLabel ID="ASPxLabel3" runat="server" Font-Names="Berlin Sans FB Demi" Font-Size="Medium"
                    Text="Packing Options" ForeColor="#FF3300">
                </dx:ASPxLabel>
                <dx:ASPxComboBox ID="cb_Packing" runat="server" Font-Names="Berlin Sans FB Demi"
                    ValueType="System.String" ClientIDMode="Static" DropDownStyle="DropDown" EnableSynchronization="False"
                    OnCallback="Packing_Callback" TextField="PackQuantity"
                    ValueField="PackID" ClientInstanceName="cb_Packing" 
                    EnableCallbackMode="True">
                    <Columns>
                        <dx:ListBoxColumn FieldName="PackID" Visible="False" />
                        <dx:ListBoxColumn Caption="Pack Quantity" FieldName="PackQuantity" />
                    </Columns>
                    <ClientSideEvents SelectedIndexChanged=" function(s,e) { OnPackChange(s); }" />
                </dx:ASPxComboBox>
                <br />
                <br />
                <dx:ASPxLabel ID="ASPxLabel4" runat="server" Font-Names="Berlin Sans FB Demi" Font-Size="Medium"
                    Text="Production Site" ForeColor="#FF3300">
                </dx:ASPxLabel>
                <dx:ASPxComboBox ID="cb_ProductionSite" runat="server" Font-Names="Berlin Sans FB Demi"
                    ValueType="System.String" ClientIDMode="Static" DropDownStyle="DropDown" EnableSynchronization="False"
                    TextField="LLName" ValueField="LLID" 
                    ClientInstanceName="cb_ProductionSite" EnableCallbackMode="True" 
                    OnCallback="cb_ProductionSite_Callback" 
                     >
                    <Columns>
                        <dx:ListBoxColumn FieldName="LLID" Visible="False" />
                        <dx:ListBoxColumn Caption="Factory Name" FieldName="LLName" />
                    </Columns>
                    <ClientSideEvents SelectedIndexChanged=" function(s,e) { OnFactoryChange(s); }" />
                </dx:ASPxComboBox>
                <br />
                <br />
                <dx:ASPxLabel ID="ASPxLabel5" runat="server" Font-Names="Berlin Sans FB Demi" Font-Size="Medium"
                    Text="Number of Products" ForeColor="#FF3300">
                </dx:ASPxLabel>
                <dx:ASPxTextBox ID="atb_Quantity" runat="server" Width="170px">
                </dx:ASPxTextBox>
                <br />
                <dx:ASPxButton ID="ab_Produce" runat="server" Text="Produce" 
                    Font-Names="Arial Black" Font-Size="Medium" OnClick="ab_Produce_Click" 
                    CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                    SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css">
                </dx:ASPxButton>
                <dx:ASPxComboBox ID="ASPxComboBox1" runat="server" Font-Names="Berlin Sans FB Demi"
                    ValueType="System.String" ClientIDMode="Static" DropDownStyle="DropDown" EnableSynchronization="False"
                    TextField="LLName" ValueField="LLID" 
                    ClientInstanceName="cb_ProductionSite" EnableCallbackMode="True" 
                    OnCallback="cb_ProductionSite_Callback" 
                     >
                    <Columns>
                        <dx:ListBoxColumn FieldName="LLID" Visible="False" />
                        <dx:ListBoxColumn Caption="Factory Name" FieldName="LLName" />
                    </Columns>
                    <ClientSideEvents SelectedIndexChanged=" function(s,e) { OnFactoryChange(s); }" />
                </dx:ASPxComboBox>
                <br />
                <br />
            </dx:PanelContent>

Code of aspx.cs

protected void Packing_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            //if (e.Parameter != "")
            //{
                using (TrackQREntities te = new TrackQREntities())
                {
                    int id = int.Parse(e.Parameter);
                    var product = te.TrackQR_ProductsCatalog.Where(s => s.PCID == id).FirstOrDefault();
                    cb_Packing.DataSource = product.TrackQR_PacksType.ToList();
                    cb_Packing.DataBind();

                    cb_Products.SelectedIndex = id;
             //   }
            }

        }

        protected void cb_ProductionSite_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            if (e.Parameter != "")
            {
                using (TrackQREntities te = new TrackQREntities())
                {
                    cb_ProductionSite.DataSource = te.TrackQR_LogisticLocations.Where(s => s.LLTypesID == 1).ToList();
                    cb_ProductionSite.DataBind();
                }
            }
        }

protected void ab_Produce_Click(object sender, EventArgs e)
        {

cb_ProductionSite.Value.ToString(); <--- Error Value is null
  • 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-05-25T22:26:25+00:00Added an answer on May 25, 2026 at 10:26 pm

    Check whether or not the ASPxComboBox.ValueType property is specified correctly according to the “Data Type Mappings (ADO.NET)” table.

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

Sidebar

Related Questions

I have an ASP.NET page using the AJAX control toolkit for some controls. A
I have a normal asp.net combobox on my web page. The current version is
I have an ASP .Net page with a radio button group and a text
I have a page in Asp.Net MVC using the Razor syntax. In the page
I have an asp.net page that will need to do some asynchronous work, e.g
I have a ASP.NET page with an asp:button that is not visible. I can't
I have an ASP.Net page that will be hosted on a couple different servers,
I have asp.net page where I am using a gridView with custom paging and
I have a ASP.Net page using ADO to query MS access database and as
I have an ASP.NET page which has a button it it. The button click

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.