I know the title may be funny for you but I am actually facing it. My page has a checkbox and textbox. I have a flash control (not developed by and so I don’t have it’s code) and a button inside that control. When the button is clicked inside flash control it causes redirection(or may be postback) to the same page but the values typed the user in textbox and checkbox are no longer available. They are lost! How can I handle this stuff? I am pulling my hair apart. I don’t even the source code of that control. Is there any easy way I can preserver the state of the controls?
Thanks in advance 🙂
If the flash component is causing a redirect to the same page, you would certainly lose any values in your asp controls. I don’t think there’s any way around that.
To check if it’s a redirect or postback, set a breakpoint inside the Page_Load method of your page. Click the button on the flash control and check the Page.IsPostback value.
If it’s false, and you can’t change the code of the flash component, I don’t see any simple way to solve the problem.
You could create a page method or service method that is called whenever the value of the textbox or checkbox changes, send them back using ajax, and store them in the session. Then they would be there when the user clicks the button on the flassh component. This is kind of a hack but it would work.