如何自动更改gridview中的标签文本 [英] How to change the lable text in gridview automatically

查看:85
本文介绍了如何自动更改gridview中的标签文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网格视图中有链接按钮(用于邮件)和标签(邮件状态)。



网格视图中的标签,默认文字(未发送)



如果我通过链接按钮发送邮件(对于Mail),lable的默认值将自动更改为(已发送)



帮助我这样做.. 。

I Am having link button(for Mail) and the label(status of Mail) in the grid view.

The lable in gridview with default text("Not sent")

If i sent the mail by link button(for Mail), the the default value of lable will automatically be changed into("Sent")

help me to do this...

<asp:BoundField DataField="psno" HeaderText="P.S.No" SortExpression="psno" />
<asp:HyperLinkField HeaderText="SEND MAIL" NavigateUrl="mail.aspx" 

                    Text="Send" DataNavigateUrlFields="email" 

                    DataNavigateUrlFormatString="mail.aspx?email={0}" />
<asp:TemplateField HeaderText="MAIL STATUS">
  <itemtemplate>
    <asp:Label ID="lab1" runat ="server" Text="Not Sent" >
  </itemtemplate>





提前谢谢...



Thanks in advance...

推荐答案

如果您使用两个不同的页面

那么您可以使用Windows.opener.location来获取当前页面位置。

并调用一个javascript fucntion以及一些值作为参数,bool可以为您提供已发送邮件天气邮件的状态。

在您的gridview页面上写入该函数,接受邮件状态并且

基于你可以改变标签的状态。



希望这可以帮助你。
If you are using two different pages
then you can use "Windows.opener.location" to get the current page location.
And call one javascript fucntion along with some value as parameter which can be bool gives you status of the mail weather mail has been send or not.
Write that function on your gridview page which accepting the mail status and
base on that you can change the status of the Label.

hopes this can help you.


这篇关于如何自动更改gridview中的标签文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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