Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help Me In This Scenario...

    Hi friends... when i was developing some application with the implimentation of data base and data grid, i got a small problem... my scenario is...

    i have a textbox and a datagrid in the page, i have list of student names in data base, when i enter some name in the data base the datagrid should be filled up with the name starting with that character with out occuring postback....

    Suppose, if i enter, R in the textbox i should get names of students starting with "R", and then if i continue to type "Ro" the datagrid should clear the list and update with the names starting with "Ro"....

    Can any help me in this plz.... Hope im clear with my doubt... Thanks in advance.....

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    New to the CF scene
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by nikkiH View Post
    Thanks for the reply... I dont know Ajax, is there any other way 2 do this????

  • #4
    New Coder
    Join Date
    Mar 2007
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope not really. And AJAX is very easy to use, anyway. All you have to do is wrap your textbox and your datagrid in an updatepanel and add the autopostback="true" property to your textbox. Then you add the code for the textchanged event and what will happen is that oyur page will perform an asynchrous postback : only the part of the page in the updatepanel will refresh.

    Just go to http://ajax.asp.net , you'll find the downloads for ajax and the control toolkit and some documentation too. You wouldnt need the toolkit in this case, but its always fun to take a look at it.

    The only other way i could see would be to store all your info in a hiddenfield with something like commas seperating the fields, and using javascript to recover an array from that hiddenfield and then sort through it and display only whats needed. But that would be a real pain, and not very effective loadtime wise... So learning a bit more about ajax is your best bet

  • #5
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Quote Originally Posted by RoughGuy View Post
    Thanks for the reply... I dont know Ajax, is there any other way 2 do this????
    I linked you right to a pre-made component that is part of a toolkit that does an auto-complete, very similar to what you're wanting to do.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #6
    New to the CF scene
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Friends, Trying 2 learn AJAX now, thanks for the site..... Can u plz gimme the link to download AJAX....
    Last edited by RoughGuy; 05-09-2007 at 07:17 AM.

  • #7
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,083
    Thanks
    2
    Thanked 23 Times in 23 Posts
    AJAX isn't something you download. Have a look at this tutorial.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #8
    New Coder
    Join Date
    Mar 2007
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well there ARE downloads for the dlls you need to make ajax work (the asp.net ajax framework). Thought the link I gave ya was obvious enough, theres the download button right in your face when you first open the page: http://ajax.asp.net

    And nikkiH has a point, the autocomplete might be something you'd be searching for, unless your point is not to select something but to show search data or the likes... Hope you find what you need anyway.


  •  

    Posting Permissions

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