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

  • Home
  • SEARCH
  • 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 7984079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:09:12+00:00 2026-06-04T11:09:12+00:00

I have an asp.net page with: an UpdatePanel an ObjectDataSource a GridView The update

  • 0

I have an asp.net page with:

  • an UpdatePanel
  • an ObjectDataSource
  • a GridView

The update panel looks like this:

<asp:UpdatePanel ID="MyUpdatePanel" runat="server">
    <ContentTemplate>

         <asp:DropDownList ID="MyDropDownList" runat="server"
                           AutoPostBack="True">
             ...
         </asp:DropDownList>

         <asp:TextBox ID="MyTextBox" runat="server" />

         <asp:Button ID="MySubmitButton" runat="server" text="Submit" />

    </ContentTemplate>
</asp:UpdatePanel>

When a user selects an option in the drop down list, something happens with the text box, it may be enabled or disabled, or it may be filled or emptied (depending on the selected option). This change should not affect the rest of the page (that’s why I put it inside an UpdatePanel).

Now, outside the update panel I have the rest of the page. Like this:

<asp:ObjectDataSource ID="MyObjectDataSource" runat="server"
                          SelectMethod="MySelect" 
                          TypeName="MyType">
    <SelectParameters>
        <asp:ControlParameter Name="Parameter1" Type="String" ControlID="MyDropDownList" PropertyName="SelectedValue" />
        <asp:ControlParameter Name="Parameter2" Type="String" ControlID="MyTextBox" PropertyName="Text" />
    </SelectParameters>
</asp:ObjectDataSource>

<asp:GridView ID="MyGridView" runat="server" 
                  AutoGenerateColumns="False" 
                  DataKeyNames="MY_ID"
                  DataSourceID="MyObjectDataSource">
        <Columns>
            ....
        </Columns>
</asp:GridView>

Again, the ObjectDataSource and the GridView are OUTSIDE the UpdatePanel.

But whenever I select an option in the drop down list, the SelectMethod of MyObjectDataSource is invoked!

What I am doing wrong?

Thanks in advance for your help.

Update:

I tried placing MyObjectDataSource and MyGridView in a SEPARATE update panel, but the page sill has the same behavior 🙁

  • 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-04T11:09:14+00:00Added an answer on June 4, 2026 at 11:09 am

    I found a solution.

    1. Replaced the asp:ControlParameters with asp:Parameters.
    2. Added a call to MyGridView.DataBind in MySubmitButton.Click() event.
    3. Assigned values to the parameters in MyObjectDataSource.Selecting() event.

    Now the SelectedMethod of MyObjectDataSource is invoked only when the user clicks MySubmitButton.

    🙂

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

Sidebar

Related Questions

I have this serious: I have ASP.NET page, This page contents Update panel with
I have this ASP.NET page with ASP.NET UpdatePanel and jQueryUI droppable and sortable components.
In an asp.net/c# application, I have an update panel on my main page. And
I have a GridView in an UpdatePanel (ASP.Net 2.0) . I have this code
I have an asp.net page for a simple blog which looks like <asp:TextBox ID=txtContent
I have an ASP.Net 2.0 page that contains two UpdatePanels. The first panel contains
I have a asp.net page, and would like to know whether script1 is already
I have some updatepanels in asp.net page. I want updatepanel 2 get refreshed when
Old hand at ASP.NET, new to the UpdatePanel. I have a reporting page which
I have a situation where I have a page in ASP.NET. In this page

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.