如何在C#代码后面获取span标签文本 [英] How to get span tag text on C# code behind

查看:639
本文介绍了如何在C#代码后面获取span标签文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1



此文本为span标签



内部文本将是1或2或3 ...直到10



如何在C#

1

this text is in span tag

The inner text will be 1 or 2 or 3... Till 10

How can i get this span text in C#

推荐答案

嗨基肖尔



试试这个,



aspx:

Hi Kishore

try this ,

aspx:
<span id="spancontrol" runat="server">content</span>





代码背后:



code behind:

var text =  spancontrol.InnerText;





注意:

如果跨度值发生变化在客户端(javascript)。它不会反映在背后的代码(.cs)中。 [spancontrol.InnerText仅包含原始值]



Note:
If the span value is changed in the client side ( javascript ). It wont reflect in the code behind (.cs). [spancontrol.InnerText will contain the original value only]


这篇关于如何在C#代码后面获取span标签文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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