将标签控件中的值转换为字符串 [英] converting the value in label control into the string

查看:74
本文介绍了将标签控件中的值转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将标签控件中的值转换为字符串.

HOw to convert the value in lable control into the string..

GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
       Label Username = (Label)row.FindControl("UserName");

推荐答案

很难理解您的要求,但这
Well its hard to understand what you are asking but this
string lblText = Username.Text;


会给您标签文本.

如果这不是您要的内容,请尝试更好地解释您想做的事情.


will give you the labels text.

If this is not what your are asking for try to explain better what you want to do.


也许我听不懂您的意思,但是请尝试:

Maybe I didn''t understand tou right, but try:

var labelString=Username.Text;



?:)



?:)


这篇关于将标签控件中的值转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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