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