日期:2014-05-17 浏览次数:20451 次
public static string pwdsValue = "aaaaa";
protected void Page_Load(object sender, EventArgs e)
{
pwdsValue = "aaaaa";
//pwds.Value = "aaaaa";
//pwds.Attributes.Add("value", "aaaaa");
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "", string.Format("<script>alert('{0}');</script>", Request.Form["Secrit"].ToString()));
}
<div>
<input id="pwds" class="text" type="password" name = "Secrit" value='<%=pwdsValue %>'/>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
</div>