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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:01:49+00:00 2026-05-10T22:01:49+00:00

I have created 2 dropdownlists that are binded to a SQL DB and then

  • 0

I have created 2 dropdownlists that are binded to a SQL DB and then pulling up a GridView. But, more specifically is there a way to have 3 user picked boxes and then have a Gridview show up? I would like to have a quick efficient way to do this without problems. I created the first 2 DDLs with autopostback and not working properly. any suggestions?

    <asp:Label ID='CustomerNumberLabel' runat='server' Text='Customer Number ' Width='125px'></asp:Label>     <asp:DropDownList ID='CustomerNumber' runat='server' AutoPostBack='True'          DataSourceID='ADDRDataSource' DataTextField='SACSNO'          DataValueField='SACSNO' AppendDataBoundItems='True'>         <asp:ListItem Text='Select a Customer' Value='' Selected='True' />     </asp:DropDownList><br />     <asp:SqlDataSource ID='ADDRDataSource' runat='server'          ConnectionString='<%$ ConnectionStrings:iSeriesHistoryConnectionString %>'          SelectCommand='SELECT [SACSNO] FROM [ADDR] WHERE ([SARP#1] = @column1)'>         <SelectParameters>             <asp:SessionParameter Name='column1' SessionField='userName' Type='Decimal' />         </SelectParameters>     </asp:SqlDataSource>      <asp:Label ID='ShipToNumberLabel' runat='server' Text='Ship-to Location ' Width='125px'></asp:Label>        <asp:DropDownList ID='ShipToNumber' runat='server'          DataSourceID='ADDRShipToNumberDataSource' DataTextField='SASHNM'          DataValueField='SASHNM' AutoPostBack='True'>         <asp:ListItem Text='Select Ship-To Location' Value='' Selected='True' />     </asp:DropDownList>     <asp:SqlDataSource ID='ADDRShipToNumberDataSource' runat='server'          ConnectionString='<%$ ConnectionStrings:iSeriesHistoryConnectionString %>'          SelectCommand='SELECT [SASHNM], [SASAD1], [SASAD2], [SASCTY], [SACSNO], [SASHST], [SASZIP] FROM [ADDR] WHERE ([SACSNO] = @SACSNO)'>         <SelectParameters>             <asp:ControlParameter ControlID='CustomerNumber' Name='SACSNO'                  PropertyName='SelectedValue' Type='Decimal' />         </SelectParameters>     </asp:SqlDataSource>    <br /><br />     <asp:FormView ID='FormView1' runat='server'          DataSourceID='ADDRShippingDataSource' Width='400px'>         <EditItemTemplate>             SACSNO:             <asp:TextBox ID='SACSNOTextBox' runat='server' Text='<%# Bind('SACSNO') %>' />             <br />             SASHNM:             <asp:TextBox ID='SASHNMTextBox' runat='server' Text='<%# Bind('SASHNM') %>' />             <br />             SASAD1:             <asp:TextBox ID='SASAD1TextBox' runat='server' Text='<%# Bind('SASAD1') %>' />             <br />             SASAD2:             <asp:TextBox ID='SASAD2TextBox' runat='server' Text='<%# Bind('SASAD2') %>' />             <br />             SASCTY:             <asp:TextBox ID='SASCTYTextBox' runat='server' Text='<%# Bind('SASCTY') %>' />             <br />             SASHST:             <asp:TextBox ID='SASHSTTextBox' runat='server' Text='<%# Bind('SASHST') %>' />             <br />             SASZIP:             <asp:TextBox ID='SASZIPTextBox' runat='server' Text='<%# Bind('SASZIP') %>' />             <br />             <asp:LinkButton ID='UpdateButton' runat='server' CausesValidation='True'                  CommandName='Update' Text='Update' />             &nbsp;<asp:LinkButton ID='UpdateCancelButton' runat='server'                  CausesValidation='False' CommandName='Cancel' Text='Cancel' />         </EditItemTemplate>         <InsertItemTemplate>             SACSNO:             <asp:TextBox ID='SACSNOTextBox' runat='server' Text='<%# Bind('SACSNO') %>' />             <br />             SASHNM:             <asp:TextBox ID='SASHNMTextBox' runat='server' Text='<%# Bind('SASHNM') %>' />             <br />             SASAD1:             <asp:TextBox ID='SASAD1TextBox' runat='server' Text='<%# Bind('SASAD1') %>' />             <br />             SASAD2:             <asp:TextBox ID='SASAD2TextBox' runat='server' Text='<%# Bind('SASAD2') %>' />             <br />             SASCTY:             <asp:TextBox ID='SASCTYTextBox' runat='server' Text='<%# Bind('SASCTY') %>' />             <br />             SASHST:             <asp:TextBox ID='SASHSTTextBox' runat='server' Text='<%# Bind('SASHST') %>' />             <br />             SASZIP:             <asp:TextBox ID='SASZIPTextBox' runat='server' Text='<%# Bind('SASZIP') %>' />             <br />             <asp:LinkButton ID='InsertButton' runat='server' CausesValidation='True'                  CommandName='Insert' Text='Insert' />             &nbsp;<asp:LinkButton ID='InsertCancelButton' runat='server'                  CausesValidation='False' CommandName='Cancel' Text='Cancel' />         </InsertItemTemplate>         <ItemTemplate>             Customer Detail<br />             <br />             <table class='style1' width='35px'>                 <tr>                     <td class='style2' align='center' >                         Address Line 1</td>                     <td class='style3' align='center' >                         <asp:Label ID='SASAD1Label' runat='server' Text='<%# Bind('SASAD1') %>' />                     </td>                 </tr>                 <tr>                     <td class='style2' align='center' >                         Address Line 2</td>                     <td class='style3' align='center' >                         <asp:Label ID='SASAD2Label' runat='server' Text='<%# Bind('SASAD2') %>' />                     </td>                 </tr>                 <tr>                     <td class='style2' align='center'>                         City</td>                     <td class='style3' align='center' >                         <asp:Label ID='SASCTYLabel' runat='server' Text='<%# Bind('SASCTY') %>' />                     </td>                 </tr>                 <tr>                     <td align='center' class='style2'>                         State</td>                     <td class='style3' align='center' >                         <asp:Label ID='SASHSTLabel' runat='server' Text='<%# Bind('SASHST') %>' />                     </td>                 </tr>                 <tr>                     <td align='center' class='style2'>                         Zip</td>                     <td class='style3' align='center' >                         <asp:Label ID='SASZIPLabel' runat='server' Text='<%# Bind('SASZIP') %>' />                     </td>                 </tr>             </table>             <br />         </ItemTemplate>     </asp:FormView>     <asp:SqlDataSource ID='ADDRShippingDataSource' runat='server'          ConnectionString='<%$ ConnectionStrings:iSeriesHistoryConnectionString %>'          SelectCommand='SELECT [SACSNO], [SASHNM], [SASAD1], [SASAD2], [SASCTY], [SASHST], [SASZIP] FROM [ADDR] WHERE ([SASHNM] = @SASHNM)'>         <SelectParameters>             <asp:ControlParameter ControlID='ShipToNumber' Name='SASHNM'                  PropertyName='SelectedValue' Type='String' />         </SelectParameters>     </asp:SqlDataSource> 
  • 1 1 Answer
  • 2 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. 2026-05-10T22:01:50+00:00Added an answer on May 10, 2026 at 10:01 pm

    You can turn off AutoPostBack for all the DropDownLists, and add a Button called Lookup with something like the following in the Lookup Button_Click event:

    ADDRShippingDataSource.SelectParameters.Clear()  If ShipToNumber.SelectedValue <> '' Then     ADDRShippingDataSource.SelectParameters.Add('SASHNM', ShipToNumber.SelectedValue) End If  If CustomerNumber.SelectedValue <> '' Then     ADDRShippingDataSource.SelectParameters.Add('SACSNO', CustomerNumber.SelectedValue) End If  ADDRShippingDataSource.DataBind() 

    Your select command would need to be updated to include the additional criteria in your DataSource:

    SELECT [SACSNO], [SASHNM], [SASAD1], [SASAD2], [SASCTY], [SASHST], [SASZIP] FROM [ADDR] WHERE (@SASHNM IS NULL OR [SASHNM] = @SASHNM) OR (@SACSNO IS NULL OR [SACSNO] = @SACSNO) 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a PHP-script to update a web server that is live inside
I have created a UserControl that has a ListView in it. The ListView is
I have created a few small flash widgets that stream .mp3 audio from an
i have created a workflow activity that do give the item creater of a
I have created a foreign key (in SQL Server) by: alter table company add
I have a page that contains some dynamically created controls (TextBox and DropDownList). When
In my code I have 2 ComboBox DropDownLists, created by the code below. The
I have created a ASP.NET WebForms Gridview and I need to access each row
I have created an Address user control which is as follow: <%@ Control Language=C#
Have created a c++ implementation of the Hough transform for detecting lines in images.

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.