如何格式化数据 [英] How Do I Format The Data
本文介绍了如何格式化数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用asp.net和sql
我的问题是
i表中有3列。
i应该以这种方式填充数据
日期:2014-09-22
Description1:xyz(这应该是粗体)
描述2 pqrs(正常段落)
水平标记后
应该出现另一个数据
------------------------------------------ -------------
日期:2013-09-22
描述1:abcd(这应该粗体)
描述2 qwe(正常段落)
i能够在gridview中填充数据,但我不知道如何格式化以这种方式的数据。我是asp.net的新手
建议我使用一些工具或链接或者请帮助我们编写代码
解决方案
您是否尝试过自己寻找解决方案?
有很多关于这个问题的帖子
格式化日期时间gridview
< asp:repeater id = Repeater1 runat = server ondatabinding = Repeater1_DataBinding xmlns:asp = #unknown >
< itemtemplate >
< p > Date:< asp:literal runat = server id = litDate text = <%#DataBinder.Eval(Container.DataItem, 编辑)%> > < / asp:literal > < / p >
< p > 描述1: < asp:literal runat = server id = litDesc1 text = <% #DataBinder.Eval(Container.DataItem, 描述 )%> > < / asp:literal > < / p >
< p > 说明2:< asp:literal runat = 服务器 id = litDesc2 text = <%#DataBinder.Eval(Container.DataItem, Description2)%> > < / asp:literal > < / p >
< / itemtemplate >
< separatortemplate >
< ; hr / >
< / separatortemplate >
< / asp:repeater >
I am using asp.net and sql
My problem is
i have 3 columns in a table.
i should populate the data in such a manner
Date: 2014-09-22
Description1: xyz(this should be bold)
Description2 pqrs (normal paragraph)
after a horizontal tag
another data should appear
-------------------------------------------------------
Date: 2013-09-22
Description1: abcd(this should be bold)
Description2 qwe (normal paragraph)
i am able to populate the data in a gridview but i dont know how to format the data in this manner. i am new to asp.net
suggest me the some tools or links or please help in writing code
解决方案
have you tried to look for the solution by yourself?
there are a lot of posts about that question
format datetime gridview
<asp:repeater id="Repeater1" runat="server" ondatabinding="Repeater1_DataBinding" xmlns:asp="#unknown"> <itemtemplate> <p>Date: <asp:literal runat="server" id="litDate" text="<%# DataBinder.Eval(Container.DataItem, "EDate") %>"></asp:literal></p> <p>Description 1: <asp:literal runat="server" id="litDesc1" text="<%# DataBinder.Eval(Container.DataItem, "Description") %>"></asp:literal></p> <p>Description 2: <asp:literal runat="server" id="litDesc2" text="<%# DataBinder.Eval(Container.DataItem, "Description2") %>"></asp:literal></p> </itemtemplate> <separatortemplate> <hr /> </separatortemplate> </asp:repeater>
这篇关于如何格式化数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文