Last post Jan 13, 2014 10:47 PM by chetan.sarode
Jan 07, 2014 10:37 AM|mrwww76|LINK
I have an updatepanel that contains an ImageButton that has a poupcontrolextender AND must also trigger an async postback (just to be clear I am NOT referring to the ModalPopupExtender).
When the image button is clicked the AJAX Popup Control is displayed, but the subsequent postback is always a full postback instead of an async postback even though its in an UpdatePanle with ChildTriggers sent to True (and IsInAsycPostback it always false).
If I remove the popupcontrolextender then the click is seen correctly as an async postback.
Here is what Im trying to accomplish:
I have several poupcontrolextenders on the page that appear when image buttons are clicked. These panels contain .NET controls for filtering. Because these panels are visually
controlled by AJAX, the controls in the panel can be made visible if a person disabled CSS on a page. In order to better secure the page I had wanted to set the visibility of the controls in the panel server-side so that disabling CSS does not display contents
of the panel.
The problem is that poupcontrolextender does not contain a server-side option for .Show() or .Hide(). Therefore I cannot go back to the server - set visibility = true - and then say
PopupControlExtender.Show(). To work around this issue, I had hoped I could use the PopControlExtender to display the panel and then perform an async Postback to set the visibility of the controls in the panel. However, it doesn’t work because having the imagebutton
that is both a poupcontrolextender and an async postback trigger always does a full postback.
I chose the poupcontrolextender because it will automatically positions itself near the button that opened it AND it automatically closes when it loses focus. Any ideas on how
to better accomplish this?
Jan 08, 2014 02:11 AM|Happy Chen - MSFT|LINK
According to your description, i think that your imagebutton control causes to do a full postback.
i would suggest you try to use image tag.if you want to use imagebutton indeed, you need to use
if it is not helpful, could you provide any additional code or markup related to this issue? It may be a bit easier to resolve if it can be easily reproduced.
Thank you for your understanding.
Jan 10, 2014 11:19 AM|mrwww76|LINK
Its funny that you mention that because the "buttons" were originally basic asp:Image controls with onclick events since I had no need to go back to the server at the time. I got it working using this code and then checking the EventAurg on postback for
'updateMenu'. I realized that while I can pass anything I want with doPostback, if the control parameter is not a real update panel on the page, then its always seen as a full postback.
<asp:ImageButton ID="imgMoreOptions" runat="server" ImageUrl="~/images/icons/desc.gif" onmouseout="UnTip()" OnClientClick="ResetRefreshTime(this, true); _doPostback('updateMenu'); return false;" />
<Ajax:PopupControlExtender ID="popupExtenderFilter" runat="server" BehaviorID="popupOptions" OffsetX="-125" PopupControlID="panelPopup" Position="Bottom" TargetControlID="imgMoreOptions" ></Ajax:PopupControlExtender>
<asp:UpdatePanel ID="updateMenu" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" >
<!-- Nothing here. Panel only needed to trigger true async postback from JS -->
<asp:Panel ID="panelPopup" runat="server" Style="display: none" DefaultButton="btnSetFilter">
<asp:UpdatePanel ID="updatePopupMenu" runat="server" UpdateMode="Conditional" >
<!-- Some controls that can now be set server-side -->
Unfortunately, my code seems to take a noticeable performance hit with this change so I’m still looking into that. But it does work.
Jan 13, 2014 04:35 AM|Happy Chen - MSFT|LINK
Thanks for your reply.
if it is related to the performance, you maybe need to check out your codes .
you can put debug point(Break Point) here , run in debug mode, after pressing F5, press F10 to check the for loop.
How about your test results, whether it had resolved your problem or have the latest error or have any questions please do not hesitate to contact me.
Jan 13, 2014 10:47 PM|chetan.sarode|LINK
Refer this - http://forums.asp.net/t/1076516.aspx