0
我在主頁面中彈出登錄usercontrol,一旦登錄後我希望內容頁面上的另一個用戶控件自動出現,目前只有在手動刷新頁面時纔會出現。這怎麼能完成。謝謝。在登錄後使用戶控件可見
母版 - >登錄用戶控件
View.aspx - >書籤用戶控件(應該出現在登錄後)
登錄在母版頁上View.aspx
<asp:UpdatePanel ID="login" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnlLogin" runat="server">
<asp:TextBox ID="txtpassword" runat="server" TextMode="Password </asp:TextBox>
<asp:Button ID="btbookmark" runat="server" Text="Login" OnClick="btbookmark_Click"/>
</asp:Panel>
<asp:Panel ID="pnlData" runat="server">Placeholder for bookmark data. Bookmark data goes here.
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
書籤用戶控件用戶控件
<asp:TextBox ID="txtbookmark" runat="server"></asp:TextBox><br />
<asp:Button ID="btmark" runat="server" />
登錄後如何才能將書籤用戶控制View.aspx出現。我需要使用更新面板嗎?
如何通過刷新頁面來顯示書籤控件? – Aaron 2012-02-14 19:23:26
@Aron在將屬性Visible設置爲true之前,後面的代碼可能會檢查!IsPostBack。此外,請注意頁面生命週期以及諸如Page_Load,Page_LoadComplete,Page_PreRender等的自動有線事件。這些事件通常按以下順序調用:頁面,母版頁,頁面中的用戶控件,母版頁中的用戶控件。此外,爲控件連接的事件取決於控件在給定頁面上的顯示順序。沒有看到代碼,很難確定發生了什麼。 – Candide 2012-02-14 19:39:05
這聽起來像我的問題在創建會話的主頁面中的登錄用戶控件在頁面書籤控件之後執行,我想要將其更改爲可見。建議? – Aaron 2012-02-14 19:55:59