Results 1 to 4 of 4

Thread: [RESOLVED] Rebind Sqldasource on controlparameter changed

  1. #1

    Thread Starter
    Lively Member n3xus's Avatar
    Join Date
    Feb 2007
    Location
    c:\Programme files\
    Posts
    98

    Resolved [RESOLVED] Rebind Sqldasource on controlparameter changed

    I have a gridview connected to sqldatasource and regular textbox.

    In sqldatasource I defined selectparameters controlparameter to textbox.

    I'm trying to rebind gridview when textbox text is changed.

    So question is how can I rebind sqldatasource?

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Rebind Sqldasource on controlparameter changed

    Hey,

    Can you show the ASPX markup for the page that you are using?

    You would either have to set the TextBox AutoPostBack property to true, so that the page post backs each time the text changes, or you would need to provide a Button which the user could push once they have finished editing the textbox, to then post back the page to the server, thus rebinding the controls on the page.

    Gary

  3. #3

    Thread Starter
    Lively Member n3xus's Avatar
    Join Date
    Feb 2007
    Location
    c:\Programme files\
    Posts
    98

    Re: Rebind Sqldasource on controlparameter changed

    Quote Originally Posted by gep13 View Post
    Hey,

    Can you show the ASPX markup for the page that you are using?

    You would either have to set the TextBox AutoPostBack property to true, so that the page post backs each time the text changes, or you would need to provide a Button which the user could push once they have finished editing the textbox, to then post back the page to the server, thus rebinding the controls on the page.

    Gary
    thanks. autopostback solved it.

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: [RESOLVED] Rebind Sqldasource on controlparameter changed

    Hey,

    Glad you got it sorted!

    The only thing to bear in mind here is that this means that every time the text changes, a post back to the server occurs. That is a lot of round trips, which may take quite a while. Just something to bear in mind.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width