Showing posts with label content. Show all posts
Showing posts with label content. Show all posts

Monday, March 26, 2012

Call JS at end of UpdatePanels content loading

I'm trying to figure out how to call a javascript method at the end of an UpdatePanel's content reloading. I know this must be possible, but I'm not seeing how yet.

Here's what I have: one page with an update panel. Contained within the update panel is a series of controls, much like a wizard. Each control has a button that posts back to the server, which then loads a different control. By using the UpdatePanel, the postback is hidden, which is nice. What I want is for every time the control within the UpdatePanel is changed for some custom javascript to run. The script just resets a page-scoped timer that notifies the user his session is about to expire. How can I hook in to the postback and run my one line of script? Thanks.

Of course after hours of searching and posting I finally find an example using the PageRequestManager that does the trick nicely. For the record, the simple script was:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{ extendSession();// My JS method }

Saturday, March 24, 2012

Calender control positioning problem

I have got two issues with calender control

1)I have body scroll="no" and div's overflow to auto(as i have menu in top div locked and content page in other div) When i use calender control the position of popup is offset to the targetcontrolid i.e it is not docked below targetcontrol id. TargetControl is at the bottom of div so user has to scroll to reach that control. Is there any way to render the popup aligned with targetcontrol as it is done when body scroll="yes". I have also tried with body's style="overflow-y:hidden" and got same offset issue.

2) In addition to above scenario, if i have dropdownlist below target control, than calender control seems to be hidden partially. Is there any way to set z-index so that calender control will always be rendered on top of dropdownlist.

It's the divs that are controling where the calendar is position. Did you play with the absolute value? That will let you add the calendar wherever you want in the page, the only control that has problems positioning with divs is the dropdown in IE6. Do you want me to send you some div code?
sure you can send me the code...i will highly appreciate that..