我想在viewdatesbutton.jpg
单击时添加 TID 的值,以便可以将其传递到另一个网页。
我怎样才能做到这一点?
代码:
<asp:repeater id="Repeater1" datasourceid="SqlDataSource1" runat="server">
<itemtemplate>
<div class="content-1g">
<div class="content-1-1g">
</div>
<div class="content-1-2g"><p class="none"><%# Eval("TName")%></p><p><span style="color:#FFFFFF"><%# Eval("TDetails")%></span></p>
<div class="content-1-2ag">
<div class="content-1-3g">Duration: <%# Eval("TDuration")%> </div>
<div class="content-1-3g">Adult: £<%# Eval("TPriceadult")%> </div>
<div class="content-1-3g">Senior/Student: £<%# Eval("TPricesenior")%> </div>
<div class="content-1-3g">Child: £<%# Eval("TPricechild")%> </div>
</div>
<div class="content-1-2bg"><img alt="" src="/images/viewdatesbutton.jpg" />
</div>
</div>
</div>
<div class="line"><hr class="top" /></div>
</itemtemplate>
</asp:repeater>
<asp:sqldatasource id="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ChinatowndbConnString %>"
SelectCommand="SELECT TID, TName, TDetails, TDuration, TPriceadult, TPricesenior, TPricechild FROM [Tour] WHERE TEventCategory=2">
</asp:sqldatasource>
我假设我可以在点击按钮时拥有一个功能?如何在其上传递 TID 的值?
问候,茶
编辑:
<asp:LinkButton ID="lbYear" runat="server" CausesValidation="false" OnCommand="redirectnewpage" CommandArgument='<%#Eval("TourId")%>'>
<asp:Image ID="imgFolder" runat="server" ImageUrl="/images/viewdatesbutton.jpg" />
</asp:LinkButton>
protected void redirectnewpage(object sender, CommandEventArgs e)
{
Response.Redirect("book.aspx?tourid="+ e.CommandArgument.ToString());
}