This is a migrated thread and some comments may be shown as answers.

Javascript and AJAX Postback

1 Answer 89 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Steve asked on 12 Sep 2009, 06:45 PM
Very simple scenario...I have a form with a div that is initially displayed.  I have a simple span with an "onclick" that toggles whether the div is displayed using the div's style.display attribute.  The form also has controls on it that do ajax postbacks to update other controls.  Let's say I hide the div client-side, then do an ajax postback.  When the ajax postback is done, the div goes back to being displayed as it was when the form initially loaded.  How can you maintain things that happen client-side with javascript after an ajax postback occurs.  If I hide the div setting style.display = 'none' and then do an ajax postback, i want the div to still be hidden.  Any help?

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 15 Sep 2009, 09:24 PM
Hello Steve,

You will need to set the display attribute of the div element on the server too. Otherwise the client setting will be overridden with every regular postback or AJAX callback.

I hope this helps.

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
Steve
Top achievements
Rank 2
Answers by
Martin
Telerik team
Share this question
or