- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个表,我想将表中的数据绑定(bind)到转发器中。但是我无法开始如何获得它。这是我的设计 HTML。我需要它在中继器中。
我想显示类似 this 的内容
我的 HTML 如下所示:-
<div class="Newsdivalign">
<div id="testMsg" class="popup">
<div class="popup-container">
<div class="popup-content">
<div class="popup-close js-popup-close modal-close">X</div>
<div>
<p class="popup-para">Recognised by the World Economic Forum as a Global Growth Company, 2014</p>
</div>
<div style="padding: 7px;">
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST</p>
<p class="SStorypara">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley
of type and scrambled it to make a type specimen book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in
the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum.
</p>
<p class="SStorypara">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley
of type and scrambled it to make a type specimen book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in
the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum.
</p>
<p class="SStorypara">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley
of type and scrambled it to make a type specimen book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in
the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum.
</p>
<p class="SStorypara">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley
of type and scrambled it to make a type specimen book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in
the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum.
</p>
</div>
</div>
</div>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#testMsg" class="modal-popup">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span> <span class="label">NGO1</span> </p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="Div1">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more </p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span> <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span> <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span> <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span> <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="Newsdiv">
<p class="Newspara"><a href="#">Recognised by the World Economic Forum as a Global Growth Company, 2014</a></p>
<p class="NewsDate">News Posted: Jan 15, 2015 – 05:08 PM EST <span class="label">NGO1</span> <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
<div class="pagination clearfix">
<a href="#">First</a>
<a href="#">«</a>
<a href="#">1</a>
<strong>2</strong>
<a href="#">3</a>
<a href="#">»</a>
<a href="#">Last</a>
</div>
</div>
请帮忙
我的更新代码:-
<asp:Repeater ID="rptNews" runat="server">
<ItemTemplate>
<div class="Newsdiv">
<p class="Newspara"><a href="#"><%#Eval("title")%></a></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
</ItemTemplate>
</asp:Repeater>
代码隐藏:-
public void bindRepeater()
{
DataTable dtInfo = new DataTable();
dtInfo.Columns.Add("title");
DataRow dr;
for (int i = 0; i < 5; i++)
{
dr = dtInfo.NewRow();
dr["title"] = DateTime.Now.ToShortDateString();
dtInfo.Rows.Add(dr);
}
}
最佳答案
试试这个。将这个中继器放在您的设计中。
<asp:Repeater ID="rptNews" runat="server">
<ItemTemplate>
<div class="Newsdiv">
<p class="Newspara"><a href="#"><%#Eval("News_Title")%></a></p>
<p class="NewsDate">News Posted:<%#Eval("News_Time")%> <span class="label">NGO1</span> <span class="label">NGO1</span></p>
<p class="NewsDate1"><a href="#">Click here</a> to know more</p>
</div>
</ItemTemplate>
</asp:Repeater>
并根据它从你的数据库中获取数据。在这里,我正在创建演示数据表以在中继器中绑定(bind)静态数据。您可以将其更改为您的数据库数据。
public void bindRepeater()
{
DataTable dtInfo = new DataTable();
dtInfo.Columns.Add("News_Title");
dtInfo.Columns.Add("News_Time");
DataRow dr;
for (int i = 0; i < 5; i++)
{
dr = dtInfo.NewRow();
dr["News_Time"] = DateTime.Now.ToShortDateString();
dr["News_Title"] = "Recongition statement";
dtInfo.Rows.Add(dr);
}
rptNews.DataSource = dtInfo;
rptNews.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bindRepeater();
}
}
关于c# - 将表中的数据绑定(bind)到前端的转发器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28379551/
我想知道从 IMAP 帐户转发邮件的最快和最可靠的方法是什么。 我的大学不允许我们的学生邮箱转发到私有(private)电子邮件帐户(这里每个人都使用 Gmail 或 Hotmail)。这是一个政治问
我正在使用 .net 构建的网站 下面的代码 输出类似...的内容 Title Div contents Title Div con
我在访问 HTML 元素时遇到问题。在服务器端,这些元素存在于转发器控件的 itemTemplate 中。 简单代码:
下面是我用来重定向端口 8080 上的常规 HTTP 请求的简单脚本,它会立即根据源 IP 地址重定向(至少使它们成为)它们。 它有效(对于 HTTP),但是我希望对来自 443 端口的 HTTPS
我在HTML中初始化了一个中继器colorSetOne,然后,我想用另一个中继器colorSetTwo替换,该怎么做(它可以由事件触发)?这是 jsfiddle :http://jsfiddle.ne
我在前端创建了一个中继器,我需要添加多个项目,第二个项目是一个字符串,这需要添加到图像 src,有什么想法吗?
我想用 socat 创建一个端口转发器,以便通过单个 openssl channel 重定向多个分支连接。我可以在不使用任何 tun 或 vpn 的情况下在 socat 中执行此操作吗? 到目前为止,
我正在尝试创建一个包含表格的 HTML 模板。表中的每一行都应该代表我拥有的一个结构,并包含来自该结构的值。 我找到的唯一相关引用资料是:golang template - how to render
您好,感谢您阅读本文。 有什么方法可以让我的 Repeater 数据绑定(bind)以仅列出包含与我的 QueryString 中的单词/数字相等的内容的行? 这是我的 Nav Url 示例,其中包含
我在 JQuery Carousel 中使用 ASP Repeater,就像在 link 中一样.我在我的 .aspx 页面中添加了所有引用和链接,我的代码是: Movies
我想用中继器显示文件夹图像中的图片,但我不知道为什么无法显示问题图片。
我有一个字典列表,我是这样创建的: List> _list = new List>(); var q = from d in db.TT_DELIVERies
我正在使用 woocommerce-advanced-checkout-fields 插件并在计费部分添加了一个转发器字段,如下所示 如上图所示,中继器字段“姓名/电子邮件”适用于产品“腰带” 现在,
我有以下简单的 NodeJS 脚本,想稍微修改一下.... var sys = require( 'sys' ), net = require( 'net' ); var outputserver =
我的 aspx 中有一个转发器: 在网络的 C# 端我写了这个函数: protected void createRadioButtons(DataSet ds){ List butto
我在 stackoverflow 博客上的 OpenID 帖子中读到了这条评论。 Kibbee says : One nice feature of OpenID that I use is the
我有一个这样的中继器: " Text="" /> 我像这样将数据源绑定(bind)到转发器: Dim dbRooms As New pbu_
我这里有一个非常基本的 sitecore 问题。我想遍历一组子对象(位置),并显示有关每个子对象的一些信息。 我正在使用 ASP 转发器进行迭代,我正在加载页面上的 child ,我正在尝试使用 sc
我正在尝试使用来自 AngularJS 的数据填充 Bootstrap Carousel 组件。基本上我在 carousel-inner 类中填充项目是这样的:
我是 Node.js 的新手,但我想将它用作一个快速的 Web 服务器,它只需接收请求 uri,然后在返回 JSON 流的内部服务上运行查询。 即像这样: http.createServer(func
我是一名优秀的程序员,十分优秀!