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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:15:38+00:00 2026-05-22T16:15:38+00:00

I have a repeater inside an Update Panel. when I click the Find Books

  • 0

I have a repeater inside an Update Panel. when I click the “Find Books” button repeater is modified according to the query.

What I want is to get the value of the DropDown when I click Add To Cart Button. But I can’t get the value, instead the UpdatePanelAnimationExtender runs again. I added another button (TestingButton) inside the Update Panel. The UpdatePanelAnimationExtender runs when I click that button also.

My question is how can restrict the update panel only to the “Find Books” button? and how can I retrieve the value of DropDown outside the update panel? I added UpdateMode to conditional but it also not working.

enter image description here

aspx page

        <p>Search by Author</p>
    <asp:TextBox ID="txtAuthor" runat="server" Text="" AutoComplete="off" /><br />
    <p>Search by Publisher</p>
    <asp:TextBox ID="txtPublisher" runat="server" Text="" AutoComplete="off" /><br />
    <asp:Button ID="btnFind" runat="server" Text="Find Books" OnClick="BtnFind_Click" />
    <br />
    <p>Search by Price</p>
    <asp:RadioButtonList ID="RadioButtonList1" runat="server">
        <asp:ListItem Text="Below Rs. 1000.00"></asp:ListItem>
        <asp:ListItem Text="Between Rs. 1001 to 2500"></asp:ListItem>
        <asp:ListItem Text="Above Rs. 2501.00"></asp:ListItem>
    </asp:RadioButtonList>
    <br />
    <asp:TextBox ID="txtTest" runat="server"></asp:TextBox>
            <asp:Button ID="Button2" runat="server" Text="Button" 
        onclick="Button1_Click" />


    <asp:UpdatePanel ID="udpBooks" UpdateMode="Conditional"  runat="server">
        <ContentTemplate>
            <asp:Button ID="btnTest" runat="server" Text="Testing Button" onclick="Button1_Click" />
            <asp:Repeater ID="repBooks" runat="server" DataSourceID="SqlDataSource1" 
                onitemcommand="repBooks_ItemCommand">
                <HeaderTemplate>
                </HeaderTemplate>
                <ItemTemplate>
                    <div id="bookBorder">
                        <table width="640px" height="70px" border="0">
                            <tr>
                                <td width="51%" style="padding-top: -20px">
                                    <span class="title">Description:</span> :
                                    <%# DataBinder.Eval(Container.DataItem, "description")%>
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList2" CssClass="dropDown" runat="server" Width="100px">
                                        <asp:ListItem>1</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                        <asp:ListItem>3</asp:ListItem>
                                    </asp:DropDownList>
                                    <br />
                                    <asp:Button ID="btnAddToCart" CssClass="button" runat="server" Text="Add to Cart"
                                        OnClick="BtnAddToCart_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <br />
                </ItemTemplate>
            </asp:Repeater>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnFind" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdatePanelAnimationExtender ID="upae1" runat="server" TargetControlID="udpBooks">
        <Animations>
                 <OnUpdating>
                    <Parallel Duration="0">
                        <EnableAction AnimationTarget="btnFind" Enabled="false" />
                        <FadeOut MinimumOpacity=".5" />
                    </Parallel>
                </OnUpdating>
                <OnUpdated>
                    <Parallel Duration="0">
                        <FadeIn MinimumOpacity=".8" />
                        <EnableAction AnimationTarget="btnFind" Enabled="true" />
                    </Parallel>                    
                </OnUpdated>
        </Animations>
    </asp:UpdatePanelAnimationExtender>

Code Behind

    public partial class Default3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void SqldsOrderDetails_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {
        string author = txtAuthor.Text;
        string publisher = txtPublisher.Text;
        string select = "";


        if (author.Equals("") && publisher.Equals(""))
            select = "select bookId, ISBN, Title, publisher, author, price, description from dbo.[book]";
        else if(author.Equals("") && !publisher.Equals(""))
            select = "select bookId, ISBN, Title, publisher, author, price, description from dbo.[book] where publisher=@publisher ";
        else if(!author.Equals("") && publisher.Equals(""))
            select = "select bookId, ISBN, Title, publisher, author, price, description from dbo.[book] where author=@author";
        else if(!author.Equals("") && !publisher.Equals(""))
            select = "select bookId, ISBN, Title, publisher, author, price, description from dbo.[book] where author=@author and publisher=@publisher";

        SqlDataSource1.SelectCommand = select;
        e.Command.Parameters.Add(new SqlParameter("@author", this.txtAuthor.Text));
        e.Command.Parameters.Add(new SqlParameter("@publisher", this.txtPublisher.Text));
    }
    protected void BtnFind_Click(object sender, EventArgs e)
    {
        System.Threading.Thread.Sleep(2000);
//        this.gvOrderDetails.DataBind();
        this.repBooks.DataBind();
    }
    protected void ul_Click(object sender, EventArgs e)
    {
        Response.Redirect("default.aspx");
    }

    protected void BtnAddToCart_Click(object sender, EventArgs e)
    {
        txtTest.Text = "sd";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        txtTest.Text = "sd";
    }
    protected void repBooks_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        DropDownList d = e.Item.FindControl("DropDownList2") as DropDownList;
        txtTest.Text = d.SelectedValue;
        Button b= e.Item.FindControl("btnAddToCart") as Button;
        b.Text = d.SelectedValue;
    }
}
  • 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-22T16:15:39+00:00Added an answer on May 22, 2026 at 4:15 pm

    For triggering

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            Some content that needs to be updated here...
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="FindBook" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    

    as far as the value of DropDown into textbox is concern, you should place textbox in another updatepanel and set its value when user select a value from dropdown by calling update method.

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

Sidebar

Related Questions

I have a Repeater with a Button inside the ItemTemplate . I added the
I have one control named thumbviewer inside repeater. I want to set its imageurl
I have a few controls defined inside an update panel which are bound to
I have a repeater inside a panel. Inside this repeater I have another panel.Upon
I have inside repeater when i tried to find above placeholder in code behind
hi I have a radio button list inside a repeater , the repeater is
I have a Linkbutton inside a repeater and I want to delete the Item
I have a Repeater and inside it a GridView . Now I want to
I have Repeater with LinkButton with ID CommandArgument When I click that button, I
Basically I've got an update query that runs when you click a submit button.

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.