我想在button_click事件時顯示用戶控件。當button_click事件顯示用戶控件
用戶控逆變declartion是
<div id="divloginUControl" runat="server">
<td></td>
<td>
<LUC:LoginLoader ID="loginUserControl" runat="server" />
</td>
</div>
我與
protected void Page_Load(object sender, EventArgs e)
{
loginUserControl.Visible = false;
}
protected void Button1_Click(object sender, EventArgs e)
{
loginUserControl.Visible = true;
System.Threading.Thread.Sleep(5000);
ScriptManager1.RegisterPostBackControl(Button1);
string result = asset.UserLogin(txtloginid.Text, txtpassword.Text);
if (Convert.ToInt32(result) == 1)
{
Session["uname"] = txtloginid.Text;
Server.Transfer("CreatedInventory.aspx");
}
else
{
pwdinfo.Text = "Please enter correct password";
txtpassword.Focus();
}
}
嘗試,但它不能正常工作,請給一些suggetions
如何不工作?你在哪裏設定了這個值? – nphx
更多代碼專業 – tariq
您是否嘗試過調試? –