/
United States
- New york city, New york, USA
- Los angeles, California, USA
- Chicago, Illinois, USA
- Boston, Massachusetts, USA
- San francisco, California, USA
Selected value not updating
I could use the querystring to do this but I dont think thats the way its meant to work. you can use the query string...its better you store the value in a session because storing simple string values in session is recommended than storing heavy datatables or so.....unlike querystring, session values will never be shown in url also...its secure too.you can use the line just above msgbox statement also include your code in block : if not ispostback then end if actually wht happened is u wrote ur code directly in the pag_load n every time ur page gost postback ur dropdown got refilled n it is giving u the illusion it is not changing value of selectedindex change i m writing in C# convert in VB put all ur code in the if(! Is Post Back) block so that ur dropdown will be filled once n wil persist the data n upon change the index u wil be able to see the changing value hope this helps If I put all the code in a 'if not page.ispostback' then nothing will load the next time the page loads after autopostback, I think I am going to have to use the querystring or session variable if I can not find a simple solution.The funny thing is I bet this code would work if I wasnt using code behind to populate the page. ur dropdown will be filled first time when u load the page.n it is ok n agin if on each post bsck u want to make changes then make these changes in the event handler of the dropdown...if i m not understanding ur prob clearly explain again...
Possibly it is something to do with what you mention above - delete the connection string.I have to type/search again to see dropdown list (In multi select).I've seen this question pop around, and wanted to have a 1 stop reference to solve the issue for people trying to figure it out.I guess the problem is that your new key/value is not in the Users Collection.You must have in mind that combobox won't get notifyed on any new items in the Users collection, only when a new collection is setted in Cool, helps to have the whole picture in the question now.Here is a snippet as to how I have it setup with a few properties removed for brevity Thanks @jljorgenson18 what you suggested is fixed this issue.but it is causing a new issue, now the dropdown list is hiding every time I select a option.