• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 589
  • Last Modified:

asp.net updatepanel update sqldatasource

I have  a grid in an updatepanel that is bound to a sql datasource.

The sql datasource uses a stored procedure and I have the parameter value coming from a text field.

when the user clicks on a button I want to have the sql data source to update

How do I do this




<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="usp_Admin_GetAll" 
        SelectCommandType="StoredProcedure" 
        ProviderName="<%$ ConnectionStrings:on.ProviderName %>">
        <SelectParameters>
            <asp:FormParameter DefaultValue="%" FormField="txtSearch" Name="txt" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

Open in new window

0
JonMny
Asked:
JonMny
  • 2
1 Solution
 
David RobitailleAnalyst ProgrammerCommented:
it<s the grid the should be in the update panel.
click event of the button, do a grid.DataBind(), that will update the data source.
0
 
David RobitailleAnalyst ProgrammerCommented:
So, did that work?
0
 
JonMnyAuthor Commented:
That worked
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now