如何获取一个HTML元素值并将其转换为字符串? [英] how to take an HTML element value and converting it to a string?

查看:752
本文介绍了如何获取一个HTML元素值并将其转换为字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,可以说我有一个Web浏览器...有一个名为11的数字,但是它的值不是11,好吧,它可以是任何东西.我想珍惜这一价值.

ok, lets say i have a web browser... there is a number named 11. however its value is NOT 11, well, it can be anything. I want to take that value. how to i take that number value, and place that number into a label?

推荐答案

等一下,我可能刚知道您的意思:您在问吗?如何将任何数字的值放入标签中,以便可以从服务器代码在客户端网页上看到它?如果是这样,请将此代码添加到您的Page Load事件中:
Hang on, I may have just got what you are on about: Are you asking how you put the value of any number into a label so that it is visible on a client web page from the server code? If so, add this code to your Page Load event:
int i;
i = 123 + 435;
myLabel.Text = i.ToString();


这篇关于如何获取一个HTML元素值并将其转换为字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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