问题描述
实际上,.aspx页中有四个按钮.
Fisrt时间页面加载第一按钮"应该被禁用.但不是第二,第三,第四
之后
第二次页面加载第二个按钮"应该被禁用.但不是第三,第四
之后
应该禁用第三次页面加载第三按钮".但是不能禁用第四次
之后
第四次页面加载第四按钮"应该被禁用.
所以现在您可以理解我要说的话了吗?那么怎么可能呢?
如果您有任何想法,请尽快告诉我.
您可以借助数据库,自动增量ID和许多提示等进行思考.实际上,我已经尝试过借助数据库进行尝试,但是它
还没做.那么怎么可能呢?
Actually I have Four Buttons in the .aspx page.
Fisrt time Page Load First Button should be disable. But not Second ,Third,Fourth
After that
Second time Page Load Second Button should be disable. But not Third,Fourth
After that
Third time Page Load Third Button should be disable..But not Fourth
After that
Fourth time Page Load Fourth Button should be disable.
So now you can understand what I am trying to say? So How it is possible?
If you have any idea then Please tell me as soon as possible.
You can think with the help of database, auto increment ID and many ideas etc. Actually I have tried with the help of database but it
have not done. So How it is possible?
推荐答案
count=0;
protected void Page_Load(object sender, EventArgs e)
{
count++;
Session["count"]=count;
if(Convert.ToInt32(Session["count"])==1)
{
// code here;
button1.Enabled=true;
button2.Enabled=false;
button3.Enabled=false;
button4.Enabled=false;
}
else if(Convert.ToInt32(Session["count"])==2)
{
// code here;
button1.Enabled=false;
button2.Enabled=true;
button3.Enabled=false;
button4.Enabled=false;
}
.
.
// so on...
}
希望对您有帮助.
如果有帮助,请不要忘记将其标记为答案. :)
Hope this will help you.
Don''t forget to mark as answer if it helps. :)
这篇关于我想问一下Fisrt时间Page Load First Button应该被禁用吗?但不是第二,第三,第四的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!