简体   繁体   English

如何在搜索按钮后禁用主表单?

[英]How to Disabled Master Form After Search Button?

** ** 单击搜索按钮后想要禁用除书籍信息之外的母版页表单 在顶部母版页表单上想要禁用除书籍信息之外的所有信息

This my Search Button Code I want to Disabled Master Page After Search Signup**这是我的搜索按钮代码,我想在搜索注册后禁用母版页**

try
            {
                signUp signUp = new signUp();
                signUp.Username = txtUserName.Text;
                Session["user"] = signUp.Authentication();
                Response.Redirect("BooksInformation.aspx");
                
            }
            catch (Exception ex)
            {
                lblOutput.Text = ex.Message;
            }

Suppose in the Master page you've got something like this:假设在母版页中你有这样的东西:

<a href="Student.aspx">Students</a>

add runat="server" and id property for the tag为标签添加runat="server"id属性

<a href="Student.aspx" id="studentLink" runat="server">Students</a>

Then in the Page_Load event of the BooksInformation.aspx make sure the user is logged in and hide the links:然后在BooksInformation.aspxPage_Load事件中确保用户已登录并隐藏链接:

var studentLink = Master.FindControl("studentLink") as HtmlControl;
studentLink.Visible = false;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM