我有以下代码,适用于按钮上的postbackurl。我需要做的是做类似的事情,但是:
<a href></a>
在asp.net中。我怎样才能做到这一点?谢谢你的帮助!
<a href="negativestorydetail.aspx?tag=<%# Eval("Tag") %>" style="color: #ff0000; text-align: center; margin: 15px; line-height: 30px; text-decoration:none; font-size: <%# GetTagSize(Convert.ToDouble(Eval("weight"))) %>"><%# Eval("Tag") %></a>
C#CODE:
protected string GenerateLinkDetails(object companyId, object projectName, object projectId) {
return string.Format("~/projectdetails.aspx?guid={0}&name={1}&role={2}&member={3}&company={4}&project={5}&proj_id={6}", id, name, company_role, mem_id, companyId, projectName, projectId);
}
ASP.NET代码:
<asp:Button ID="LinkButtonDetails" runat="server" Text="DETAILS" PostBackUrl='<%# GenerateLinkDetails(Eval("CompanyID"), Eval("ProjectName"), Eval("ProjectID")) %>' />