将Web控件从字符串转换为十进制。 [英] Converting web control from string to decimal.

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

问题描述

我创建了一些代码,用于查找从SQL查询生成的数据列表中的控件。它接受控制并将数据放入字符串中。这是代码。

I have created some code that finds controls in a datalist that is generated from a SQL query. It takes the control and puts the data into a string. Here is the code.

展开 | 选择 | Wrap | 行号

推荐答案

您是否尝试过打印c0a的值。 ToString()返回?
Have you tried printing what value c0a.ToString() returns?


它只显示LabelSystem.Web.UI.WebControls.TextBox。它应该显示23。
It is only showing a LabelSystem.Web.UI.WebControls.TextBox. It should be displaying 23.


我将假设c0a是你创建的webControl的一个实例。


覆盖该控件中的ToString方法返回textBox中的文本
i will presume that c0a is an instance of your webControl you created.

Override the ToString method in that control to return the text in the textBox


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

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