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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:03:50+00:00 2026-05-16T08:03:50+00:00

i am having two list box which perform add remove item functionality which are

  • 0

i am having two list box which perform add remove item functionality which are controlled by four buttons and o each button click there happen to be post back but i don’t want it to be flicker for which i am using update panel like this but it still made post back wats wrong with this explain me this

<asp:UpdatePanel ID="button" runat="server" UpdateMode="Always">
    <ContentTemplate>
        <asp:Button ID="ButtonAdd" runat="server" Text=">" OnClick="ButtonAdd_Click"  Width="50px"/><br />
        <asp:Button ID="ButtonRemove" runat="server" Text="<" OnClick="ButtonRemove_Click" Width="50px"/><br />
        <asp:Button ID="ButtonAddAll" runat="server" Text =">>>" OnClick="ButtonAddAll_Click" Width="50px"/><br />    
        <asp:Button ID="ButtonRemoveAll" runat="server" Text ="<<<" OnClick="ButtonRemoveAll_Click" Width="50px"/>
    </ContentTemplate>
</asp:UpdatePanel>
  • 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-16T08:03:51+00:00Added an answer on May 16, 2026 at 8:03 am

    I wrote a quick example that does work. You do not need your buttons in the UpdatePanel. You only need the ListBox since they are the only controls being refresh. Setup the Trigger for the UpdatePanel will cause the refreshes to occur without the ‘flicker‘.

    aspx code:

    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div>
        <asp:Button ID="ButtonAdd" runat="server" Text=">" OnClick="ButtonAdd_Click"  Width="50px"/><br /> 
        <asp:Button ID="ButtonRemove" runat="server" Text="<" OnClick="ButtonRemove_Click" Width="50px"/><br /> 
        <asp:Button ID="ButtonAddAll" runat="server" Text =">>>" OnClick="ButtonAddAll_Click" Width="50px"/><br />     
        <asp:Button ID="ButtonRemoveAll" runat="server" Text ="<<<" OnClick="ButtonRemoveAll_Click" Width="50px"/>     
        <asp:UpdatePanel ID="button" runat="server" UpdateMode="Always">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ButtonAdd" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="ButtonRemove" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="ButtonAddAll" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="ButtonRemoveAll" EventName="Click" />
            </Triggers>
            <ContentTemplate>
                <asp:ListBox ID="ListBox1" runat="server"></asp:ListBox>
                &nbsp;&nbsp;
                <asp:ListBox ID="ListBox2" runat="server"></asp:ListBox>
            </ContentTemplate> 
        </asp:UpdatePanel>
    </div>
    

    cs (codebehind) code:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ListBox1.Items.Add(new ListItem("Test1", "1"));
            ListBox1.Items.Add(new ListItem("Test2", "2"));
            ListBox1.Items.Add(new ListItem("Test3", "3"));
            ListBox1.Items.Add(new ListItem("Test4", "4"));
            ListBox1.Items.Add(new ListItem("Test5", "5"));
        }
    }
    
    protected void ButtonRemove_Click(object sender, EventArgs e)
    {
        if (ListBox2.SelectedItem != null)
        {
            ListBox1.Items.Add(ListBox2.SelectedItem);
            ListBox2.Items.RemoveAt(ListBox2.SelectedIndex);
            ListBox2.ClearSelection();
            ListBox1.ClearSelection();
        }
    }
    
    protected void ButtonAdd_Click(object sender, EventArgs e)
    {
        if (ListBox1.SelectedItem != null)
        {
            ListBox2.Items.Add(ListBox1.SelectedItem);
            ListBox1.Items.RemoveAt(ListBox1.SelectedIndex);
            ListBox1.ClearSelection();
            ListBox2.ClearSelection();
        }
    }
    

    I have tested this and it does work. I only implemented 2 of the Buttons to present a complete example.

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

Sidebar

Related Questions

I want to have a list view with each row having two buttons like
I have two list of different objects : List<Report> List<Newsletter> each having a 'created
I am having a search page with one dropdown list box, one button and
Here i am having a unordered list displaying two columns code and name .I
I'm having a dropdown list in my web page. And it contains two lists.
i'm writing two anidated classes one is a dict the other a list? having
Having two forms, each in it's own jQuery UI tab, how can I post
I am having two activities A and B. when i click the button in
I seem to be having issues with the selected index on a list box.
I've got a popup context menu on a list box, and there are two

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.