0
自敗我宣佈這樣一個ASP.NET的超級鏈接控制:的ASP.NET LinkButton的子控件在回發
<li runat="server" id="liveChatCtrl" Visible="false"><asp:LinkButton runat="server" ID="hlnkLiveChat" CausesValidation="false" OnClick="hlnkLiveChat_Click">Live Chat Support <i class="icon icon_next_03 fr"></i><i runat="server" id="iconChat" class="icon_chat_online"></i></asp:LinkButton></li>
我的問題是LinkButton的內容回發上消失。任何想法爲什麼發生這種情況?
在負載我執行上LinkButton的下面的代碼或它的孩子們:
string absoluteURL = UtilManager.Settings.Item(Utils.BrandID, "URL:absoluteURL");
string chatLink = "StartChat.aspx";
if (HttpContext.Current.User.Identity.IsAuthenticated)
chatLink = "LiveChat.aspx";//~/
//else
// chatLink = "SalesChat.aspx";
string link = absoluteURL + chatLink;
hlnkLiveChat.Attributes["onclick"] = string.Format("javascript:window.open('{0}', 'chat', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,height=505,width=420,left=30,top=30');", link);//"openPopup('" + link + "','chat'); return false;";
liveChatCtrl.Visible = true;
你在哪裏執行超鏈接內容的代碼? – Andrei
在頁面初始化事件 – Alecu
需要檢查的東西,如果該'LinkButton'內容被封裝在一個'if(!Page.IsPostback())'中,它將首先被渲染,然後在回發中消失。 – fnostro