从后面的代码显示单行值 [英] Single Row Value in display from code behind

查看:63
本文介绍了从后面的代码显示单行值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI


如何从asp.net代码中获取Mysql单行值到html页面显示(或者我需要使用asp:Repeater for single value)



请咨询



------------------ ----------------------------------



我已经编写了mysql查询,它给了我一行



现在显示来自aspx.cs页面的aspx页面中的值



(如果我有多个值,我使用asp:repeater)



但单排是什么









问候



maulik shah

HI
how to get Mysql single row value from asp.net code behind into html page to display (or i need to use asp:Repeater for single value also)

Pls advice

----------------------------------------------------

I have written mysql query and it gives me one row

now to show values in aspx page from aspx.cs page

(if i have multiple values , i use asp:repeater )

but what for single row




regards

maulik shah

推荐答案

这不应该造成问题。当它返回一行时, Repeater 应该只显示一行。



否则,你可以查看返回的行数,根据计数,您可以决定是否使用 Repeater 或任何其他控件,如 Label 或什么。
That should not create a issue. When it will return one row, the Repeater should show only one row.

Otherwise, you can check the number of rows returned and according to the count, you can decide whether to use Repeater or any other control like Label or something.


重申Tadit指出的内容,我们决定如何以任何格式显示或表示数据。由于这些控件具有不同的模板,因此与标签,文字等中显示数据/行相比,一些数据列表控件就是为此而设计布局节省了大量时间。



因此,如果仍然可以使用其中一行显示DetailView,FormView或Repeater控件。
Reiterating on what Tadit has pointed out, its just our decision how to display or represent data in any format. Some of the data listing controls are meant for that as well as it saves lots of time on designing layout compared to displaying data/row in labels , literals etc because of the different templates these controls have.

So if its one row to be displayed DetailView , FormView or Repeater controls can still be used.


这篇关于从后面的代码显示单行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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