![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi - thanks for the help in this group so far. Regarding the click event of a link_button (created within a table and added to a placeholder at run-time) - there are a number of link_buttons added to the dyanmic table I am using (a gantt chart) - when you click on one of the link_buttons, it calls a sub which takes the reference of the table cell (a persons name, and the date - it's a resource chart) - and updates the DB with a 'booked' flag for that person for that date. However, if I redraw the table and link_buttons at the end of this update routine, the changes do not show until a subsequent post_back has been made - in effect, it looks like the updating is one click behind me. If I redraw the table from the page_load too (following Alessandro's post), it works, but only if I have also called the redraw from the update sub above (effectively doubling teh load on the app, and the calls to the database). If I don't call the redraw from both the sub, and the page_load - it doesn't work as soon as I click the link_button. Have I missed something here? Thanks, *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
I think what I'm asking is how do I update the database in the link_button click, redraw the control, without having to wait for a subsequent post_back to 'catch up'. Thanks again, *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Hi Alessandro - thanks again - that does stop it executing twice, but the code needs to execute the buttonclick, and then redraw - I plan to have the buttonclick event add an entry to the database, which will 'block off' that resources time for that day (the cell clicked). So by not redrawing at the buttonclick stage, my controls display will always appear to be one step behind (as it won't be redrawn with the updated database checks until the next postback). Is this just something I have to live with, or have my code execute the redraw twice? (I'm getting there with your help - but slowly !)*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#8
| |||
| |||
|
|
Hi Alessandro - thank you once again. I too managed to get the step through working in VS - and can as you say get the doDateArray to fire only the once. However, and this is where I was probably not too clear, the sequence of events needs to be: 1. When the user first visits the page, the table is built, and the user sees what resources/people are available on which days. 2. The days they are unavailable are blocked off (ie. they are just coloured - the others have linkbutton controls) 3. If the user wants to book a day of a resources time, they click on the cell (column is the day, the row is the resource/person) 4. By clicking on the linkbutton in the appropriate cell, a sub should be fired, which inserts a record into a database table, which shows that resources ID and the date of the relative cell they have been booked for 5. The table should then be rebuilt, reflecting the new booking just made - which will result in the cell just being clicked, being drawn as just a coloured cell It is step 5 which only catches up on the next postback - or the current postback, if I allow doDataArray to be called twice. Am I making any sense? It is so clear in my head! Sorry! *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |