在这里您可以使用更新面板,按钮和标签.... [英] Here You Can Use Update Panel, Button and Lable....

查看:67
本文介绍了在这里您可以使用更新面板,按钮和标签....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我需要用于...的代码,

在Asp.net页中,有一个更新"面板.在该更新面板中,有一个标签和一个按钮.标签以数字10填充.我的要求是,每当我单击按钮时,标签文本10就会减少到10,9 .......... 2,1,0,最后停止数字.
谢谢您发送代码....

Hi friends,

I need code for...,

In a Asp.net page, there is one Update panel. In that Update Panel, there is One Lable and Button. Lable is filled with a number for example 10.My requirement is, when ever i click the button, in the lable text 10 will be decreased to 10,9..........2,1,0 finally stop the number.
advance thankyou for sending code....

推荐答案

您将不会从我们这里接收代码,因为这在这里不起作用.
尝试编写一些代码,看看能走多远,然后问一些更具体的基于编码的问题.我们将非常乐意为您提供帮助.这是一个非常简单的任务.您只需要一个asp.net项目,一个带有文本框和更新面板中的标签的Web表单.处理按钮单击并在后面的代码中对其进行处理.继续,编码,我的好伙伴.
You will not be receiving code from us because that is not how it works here.
Try writing some code, see how far you get, and then ask more specific coding based questions. We will be very happy to help. This is a very simple assignment. All you need is an asp.net project, a web form with a text box and a label in an update panel. Handle the button click and process it in your code behind. Go forth and code, my good fellow.


您可以使用计时器来减少数字
您可以这样设置代码

Button1_Click
You can use timer to decrease the numbers
You can set the code like this

Button1_Click
Timer1.Enabled = True




Timer1_tick




Timer1_tick

If lbl1.text >=0 Then
     lbl1.text = CInt(lbl1.text) - 1
Else
     Timer1.Enabled = False
End If


这是您的Q
Here is the ans for your Q
protected void Lable_Click(object sender, EventArgs e)
    {

                   (Label)sender).Text=  (Convert.ToInt32(((Label)sender).Text)==0?0:Convert.ToInt32(((Label)sender).Text)-1).toString();
}


这篇关于在这里您可以使用更新面板,按钮和标签....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆