日期:2014-05-20  浏览次数:20875 次

如何判断LinkButton是不是第一次点击,我想第一次点击就显示一个textbox,第二次点击就提交textbox内容,然后隐藏textbox,高手出来下,谢
高手,高手,高手,高手,高手,高手出来咯

------解决方案--------------------
<%@ Page Language="C#" EnableViewState="true" AutoEventWireup="true" Debug="true" %>
<%@ Import Namespace="System.Xml" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

protected void LinkButton1_Click(object sender, EventArgs e)
{
if (ViewState["x"] == null)
{
Response.Write("第一次点击");
ViewState["x"] = "";
}
else
{
Response.Write("你已经点击过了啊!!!!!!!!!");
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>dddd</title>

</head>
<body>
<form id="form1" runat="server">
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
</form>
</body>
</html>

------解决方案--------------------


 if (e.CommandName == "pinlun")
{
strID = e.CommandArgument.ToString();
LinkButton1.CommandArgument=strID ;
}