Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Facing issue while setting style: display of a panel

$
0
0

Hi All,

 I am facing one issue.But dont know whether this is issue or web page works like this only.

Following is the scenario:

I have a image Buttom in my page like below

<asp:ImageButton ID="imgBtnActions" OnClick="imgBtnActions_OnClick" ImageUrl="~/Images/icon-action_up.png?V=1"                                                runat="server" />

When i click on this button its open a Panel with some linkbutton inside the Panel. This display happened in code behind like this. ShowHideMenuAction() is called from imgBtnActions_OnClick() method.

 private void ShowAndHideActionsMenu()        {            if (pnlExpAction.Style["display"]  == "block" )            {                pnlExpAction.Style["display"] ="none";                imgBtnActions.ImageUrl = "~/Images/icon-action_down.png";            }            else            {                pnlExpAction.Style["display"] = "block";                imgBtnActions.ImageUrl = "~/Images/icon-action_up.png";            }        }
When i click any of the link button inside the Panel its minimize the paenl and do some serverside function.this panel with image button all in update panel. Minimizng happen like this 
  function InitializeRequest(sender, args) {            var asyncPostBackElement = sender._postBackSettings.asyncTarget;            if ((asyncPostBackElement == '<%= lnkBtnExplorerSave.UniqueID %>') || (asyncPostBackElement == '<%= lnkBtnExplorerCopyFund.UniqueID %>') || (asyncPostBackElement == '<%= lnkBtnExplorerCreateChildFund.UniqueID %>') || (asyncPostBackElement == '<%= lnkBtnExplorerExclusion.UniqueID %>')) {                var panel = document.getElementById('<%=pnlExpAction.ClientID %>');                var img = document.getElementById('<%=imgBtnActions.ClientID %>');                panel.style.display = 'none';                img.setAttribute('src''../Images/icon-action_down.png');            }        }
This code minimize the paenl.But problem happend when i click the img button again.When i click the button it calls the ShowAndHideActionMenu() as written before.I kept a debugger there.It is showing still the display type is "block" though i made it "none" in ajax InitializeREquest() method.So onclick of that it is not displaying the panel since it is goign to the else part.
Could anyone please tell me why its showing "block" when i already made "none" ?
Thanks & Regards,
Joy

                       

Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>