我使用類似下面登錄控制,如何在asp.net中更新服務器端執行的UI按鈕文本?
<asp:Login ID="Login1" runat="server" DestinationPageUrl="default.aspx" OnAuthenticate="Login1_Authenticate" RenderOuterTable="false">
<LayoutTemplate>
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
<asp:TextBox ID="UserName" name="UserName" runat="server" CssClass="form-control" placeholder="Username"></asp:TextBox>
<asp:TextBox ID="Password" runat="server" TextMode="Password" CssClass="form-control" placeholder="Password"></asp:TextBox>
<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In " />
</LayoutTemplate>
</asp:Login>
在驗證我們需要改變登錄按鈕文字,並重定向到Default.aspx的page.I試圖用的RegisterStartupScript和線程都爲me.Please沒有工作讓我知道如果您有任何關於更新來自Login1_Authenticate事件的UI按鈕文本的建議。
什麼時候你想改變按鈕的文字?而其認證? – Rohit
有兩個功能,一個是它會認證的,一段時間後它會重定向。一旦通過驗證,我們需要更新ui中的按鈕文本。我試圖更新按鈕文本,但它不會反映,直到執行結束。 –
@akshaybogar無論哪種方式,在點擊** Login **按鈕之後,您將用戶重定向到另一個頁面。 ***更改按鈕文本太晚;用戶無論如何都看不到新的按鈕文本***你想達到什麼目的?你想根據用戶的角色將用戶重定向到特定的頁面嗎? – Win