绑定多个倒计时 [英] bind multiple countdown
问题描述
我的Html代码是这样的:
< asp:Repeater runat = server ID = Repeater1 >
< ItemTemplate >
< li > ;
< div class = image >
< div class = align >
< div > < a href = bidding_description.aspx?productid = <%#DataBinder.Eval(Container.DataItem, id) %> > < asp:Image ID = Image1 runat = server ImageUrl =' <%#(string)FormatImageUrl((string)Eval( imageurl))%>' / > < / a > < / div >
< / div >
< / div >
< span class =code-keyword>< div align = center > < a href = # < span class =code-keyword>> 产品:<%#DataBinder.Eval(Container.DataItem, product_Name)%> < / a > < < span class =code-leadattribute> / div >
< div align = center > 市场价格:$ <% #DataBinder.Eval(Container.DataItem, market_price )%> < / div >
<% - < h4>< a href =#>产品:<%#DataBinder.Eval(Container.DataItem,名称)%>< / a>< / h4> - %>
<% - < h4>< ; a href =bidding_description.aspx?productid =<%#DataBinder.Eval(Container.DataItem,id)%>>免费礼品:<%#DataBinder.Eval(Container.DataItem,gift)%>< / a>< / h4> - %> ;
< div >
< br < span class =code-attribute> / >
< br / >
< / div >
< div align = center >
< a href = AddToCart.aspx?ProductId = < ;% #DataBinder.Eval(Container.DataItem, Id)%> > < img src = images / bid-now-button.png alt = gdh border = 0 / < span class =code-keyword>> < / a >
< / div < span class =code-keyword>>
< / li >
< / ItemTemplate >
< / asp:Repeater >
和我的代码背后是这样的:
if (!Page.IsPostBack)
{
repeater2_datasource();
repeater3_datasource();
string dbstring = ConfigurationManager.ConnectionStrings [ database_con跨度>]的ConnectionString。
SqlConnection con = new SqlConnection(dbstring);
con.Open();
SqlDataAdapter da = new SqlDataAdapter( select *来自bidding_products,其中status ='active',con);
DataSet ds = new DataSet();
da.Fill(ds);
Repeater1.DataSource = ds;
Repeater1.DataBind();
con.Close();
}
i通过中继器绑定多个产品动态控制..它工作正常..但现在我处于为每个项目提供唯一倒计时的情况。我有开始日期和结束日期..但我不知道如何实现这个任务..如果你将帮助完成这项任务我将非常感谢..
< blockquote> <%#DataBinder.Eval(Container.DataItem, market_price)%> < / div >
<% - < h4>< a href =#>产品:<%#DataBinder.Eval(Container.DataItem,名称)%>< / a>< / h4> - %>
<% - < h4>< ; a href =bidding_description.aspx?productid =<%#DataBinder.Eval(Container.DataItem,id)%>>免费礼品:<%#DataBinder.Eval(Container.DataItem,gift)%>< / a>< / h4> - %> ;
< div >
< br < span class =code-attribute> / >
< br / >
< / div >
< div align = center >
< a href = AddToCart.aspx?ProductId = < ;% #DataBinder.Eval(Container.DataItem, Id)%> > < img src = images / bid-now-button.png alt = gdh border = 0 / < span class =code-keyword>> < / a >
< / div < span class =code-keyword>>
< / li >
< / ItemTemplate >
< / asp:Repeater >
和我的代码背后是这样的:
if (!Page.IsPostBack)
{
repeater2_datasource();
repeater3_datasource();
string dbstring = ConfigurationManager.ConnectionStrings [ database_con跨度>]的ConnectionString。
SqlConnection con = new SqlConnection(dbstring);
con.Open();
SqlDataAdapter da = new SqlDataAdapter( select *来自bidding_products,其中status ='active',con);
DataSet ds = new DataSet();
da.Fill(ds);
Repeater1.DataSource = ds;
Repeater1.DataBind();
con.Close();
}
i通过中继器绑定多个产品动态控制..它工作正常..但现在我处于为每个项目提供唯一倒计时的情况。我有开始日期和结束日期..但我不知道如何完成这项任务..如果你能帮助完成这项任务,我将非常感激..
My Html code is like this :
<asp:Repeater runat="server" ID="Repeater1" >
<ItemTemplate>
<li>
<div class="image">
<div class="align">
<div><a href="bidding_description.aspx?productid=<%# DataBinder.Eval(Container.DataItem, "id") %>"> <asp:Image ID="Image1" runat="server" ImageUrl='<%# (string) FormatImageUrl( (string) Eval("imageurl")) %>' /></a></div>
</div>
</div>
<div align="center"> <a href="#"> Product : <%# DataBinder.Eval(Container.DataItem, "product_Name") %></a></div>
<div align="center">Market Price : $ <%# DataBinder.Eval(Container.DataItem, "market_price") %></div>
<%--<h4><a href="#"> Product : <%# DataBinder.Eval(Container.DataItem, "Name") %></a></h4>--%>
<%--<h4><a href="bidding_description.aspx?productid=<%# DataBinder.Eval(Container.DataItem, "id") %>"> Free Gift : <%# DataBinder.Eval(Container.DataItem, "gift") %></a></h4>--%>
<div>
<br />
<br />
</div>
<div align="center">
<a href="AddToCart.aspx?ProductId=<%# DataBinder.Eval(Container.DataItem, "Id") %>"><img src="images/bid-now-button.png" alt="gdh" border="0" /></a>
</div>
</li>
</ItemTemplate>
</asp:Repeater>
and my code behind is like this :
if (!Page.IsPostBack)
{
repeater2_datasource();
repeater3_datasource();
string dbstring = ConfigurationManager.ConnectionStrings["database_con"].ConnectionString;
SqlConnection con = new SqlConnection(dbstring);
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from bidding_products where status='active'", con);
DataSet ds = new DataSet();
da.Fill(ds);
Repeater1.DataSource = ds;
Repeater1.DataBind();
con.Close();
}
i am binding multiple products through repeater control dynamically.. it is working fine.. but now i am in a situation of providing unique countdown for each item. i have start date and end date.. but i dont know how to achieve this task.. i will be very thankful if you will help to achieve this task..
<%# DataBinder.Eval(Container.DataItem, "market_price") %></div> <%--<h4><a href="#"> Product : <%# DataBinder.Eval(Container.DataItem, "Name") %></a></h4>--%> <%--<h4><a href="bidding_description.aspx?productid=<%# DataBinder.Eval(Container.DataItem, "id") %>"> Free Gift : <%# DataBinder.Eval(Container.DataItem, "gift") %></a></h4>--%> <div> <br /> <br /> </div> <div align="center"> <a href="AddToCart.aspx?ProductId=<%# DataBinder.Eval(Container.DataItem, "Id") %>"><img src="images/bid-now-button.png" alt="gdh" border="0" /></a> </div> </li> </ItemTemplate> </asp:Repeater>
and my code behind is like this :if (!Page.IsPostBack) { repeater2_datasource(); repeater3_datasource(); string dbstring = ConfigurationManager.ConnectionStrings["database_con"].ConnectionString; SqlConnection con = new SqlConnection(dbstring); con.Open(); SqlDataAdapter da = new SqlDataAdapter("select * from bidding_products where status='active'", con); DataSet ds = new DataSet(); da.Fill(ds); Repeater1.DataSource = ds; Repeater1.DataBind(); con.Close(); }
i am binding multiple products through repeater control dynamically.. it is working fine.. but now i am in a situation of providing unique countdown for each item. i have start date and end date.. but i dont know how to achieve this task.. i will be very thankful if you will help to achieve this task..
这篇关于绑定多个倒计时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!