如何在我的应用程序运行时更新标签文本 [英] how to update label text when my application is running

查看:105
本文介绍了如何在我的应用程序运行时更新标签文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向一些客户发送邮件。点击提交按钮后,会打开一个带标签的弹出窗口。现在发送每封邮件后我想更新后面代码中的标签文字。我知道回发后,最终结果显示。但是在这种情况下,每次发送邮件循环后我想更新label的文本。这怎么可能?

我正在使用c#

解决方案

在ASPX页面中取一个隐藏字段。

从您的代码后面更新隐藏字段值。 (例如:发送到abc@xyz.com的电子邮件)



并在您的设计代码(.ASPX页面)中创建一个javascript方法。例如UpdateLabel()



现在设置计时器,以便可以在每个时间间隔调用此方法。 (例如每2秒。)



并且在此方法中将隐藏的字段文本分配给标签文本。



这将反映出来。



Happy Coding。 :)


在pre_Render事件中我们可以更改任何服务器控件的值

I want to send mail to some clients.After clicking submit button a popup with a label is opened.Now after sending each mail I want to update the text of label in code behind.I know after postback,final result is shown.But in this case after each loop of sending mail I want to update text of label.How is this possible?
I am using c#

解决方案

Take one hidden field in your ASPX page.
From Your code behind update the hidden field value. (For example: email sent to abc@xyz.com)

And in your design code (.ASPX page) create one javascript method. for example UpdateLabel()

Now set timer so that this method can be called at every interval of time. (for example every 2 seconds.)

and in this method assign hidden field text to the label text.

This will be reflected.

Happy Coding. :)


On pre_Render event we can change the value of any server control


这篇关于如何在我的应用程序运行时更新标签文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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