We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Callback vs postback

I have some dropdowns on my form. On initial entry,all are populated to user database default value. They change dropdown1 which causes data in dropdown2 to change based on business logic. I'm using your callback panel to accomplish this to avoid the page flashing when using autopostback=true. Everything works great. Now when the user selects a value in the dropdown2 and clicks a button to do some processing, the selected value from dropdown2 is always defaulting to the first one. When using the callback panel, is it actually doing a postback and updating the viewstate? This doesn't seem to be happening. I am checking the drowdown2.SelectedItem.Text.ToString() and it's always the first in the dropdown, not the one I just selected.

8 Replies

MW Melba Winshia Syncfusion Team August 13, 2007 12:12 PM UTC

Hi,

Thank you for posting your query to us.

I am afraid that I was not able to reproduce the issue. Please refer to the following steps that I tried to reproduce it.

1. Created a sample with dropdownlist in Callback panel and also Set autopostback=true of dropdownlist.
2. Run the sample
3. Select a value in the dropdown
4. Click the button
5. The selected value will be displayed in the label.

Also I have created a simple sample to test this issue and it is available in the following link.


http://websamples.syncfusion.com/samples/Tools.Web/5.1.0.51/67277/main.htm


Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Melba





LI Linda August 14, 2007 02:31 AM UTC

Hi Melba,

Thanks for replying. I want to avoid using autopostback=true on the dropdown because I want to avoid the page flashing when reloading. This is why I'm using the callback panel so it would do a partial page update. I thought the callback would do a postback and update the viewstate, similar to an ajax call. Is this not how it works? Why would you use a callback panel if you're doing an autopostback?

Also, I copied the code in the zip file to run locally but it doesn't match the example.
Thank you


MW Melba Winshia Syncfusion Team August 14, 2007 07:17 AM UTC

Hi,

Thank you for the update.

I have modified the sample by setting autopostback as false. But still I could not find the issue and the selected value in the dropdown is correctly displayed on clicking the button. As you have mentioned here callback would do a postback and update the viewstate.

Please refer the modified sample in the below link.

http://websamples.syncfusion.com/samples/Tools.Web/5.1.0.51/67277/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Melba



LI Linda August 16, 2007 05:13 PM UTC

Hi Melba,
I have two dropdowns both are initially populated. I select a different value in the first dropdown and I use the callback to populate new listitems in the second dropdown.

The problem I am having is when I choose a value from the newly populated second dropdown and hit the button to do some processing, it does not recognize the new values in teh second dropdown. It still uses the original values. I thought the new values that were populated in the second dropdown by the callback would be in viewstate. It appears that the viewstate does not get updated.

The reason I'm doing it this way is to avoid the flash that happens when you set autopostback=true on the first dropdown.

I'm attaching an example. Please let me know if you have any questions.

Thanks so much

dropdownselect.aspx.zip


MW Melba Winshia Syncfusion Team August 17, 2007 01:04 PM UTC

Hi,

I am not able to open the dropdownselect.aspx that you have attached in this forum. So I have created a simple sample to test this issue with two dropdown and it is available in the following link.

http://websamples.syncfusion.com/samples/Tools.Web/5.1.0.51/67277_12/main.htm

In the above sample, I am not able to find the issue that you have mentioned here. Please refer to the following steps that I tried to reproduce it.

1) Created a sample with two dropdown.
2) Run the sample
3) Select the value in dropdown1. Click the button.
4) The data corresponding to selected value will be displayed in dropdown two.
5) Now select some value in dropdown2.
6) The selected value will be displayed.

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Melba



LI Linda August 17, 2007 05:54 PM UTC

Hi Melba,
I'm attaching the example again. Please let me know if you still have trouble retieving this. I'm using version 5.102.0.37

The steps you listed are not what I'm doing. The second dropdown gets populated by selecting a different option from the first drop down, not by clicking the button.

1. Create sample with 2 dropdowns and 1 button.
2. Both dropdowns are populated with data on initial entry.
3. Select a different option in first dropdown. The second dropdown gets repopulated with data based on first dropdown selection.
4. Select an option in dropdown 2. Click the button. You'll see that the selected value from dropdown 2 does not reflect what was just populated using the callback from changing value in dropdown 1. The selected value from dropdown 1 is correct.

The scenario that I'm working with is that the user changes dropdown1 which causes data in dropdown2 to change - I'm using the syncfusion callback to accomplish this. Then they click a button to run an excel report but the value in dropdown2 is not getting saved so when I run the report using the selected value from dropdown2, I'm always getting the initial value, not the value that was just repopulated by the callback.

Hope I'm explaining this. If you can't open my example, I can try to copy and paste here.

Thanks



dropdownselect.zip


LI Linda August 20, 2007 12:45 PM UTC

Hi Melba,

I submitted this in direct trac as incident 36749


MW Melba Winshia Syncfusion Team August 21, 2007 12:41 PM UTC

Hi,

Your direct-trac incident #36749 has been updated. Please follow this issue in incident #36749.

Please let me know if you have any other questions.

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon