Reputation: 8150
I have an aspx-Page with an anchor-tag. It´s href has to take a parameter of the page, which is a public member.
public int CommissionId
{
get
{
//..
}
}
I know how to design the link in code-behind, but want to do it in Markup. I tried
<a href='<% String.Format(@"Details.aspx?commissionId=" + CommissionId) %>' runat="server" id="cancelLink" class="button" onclick="this.blur();"><span>Back</span></a>
but the link doesn´t respond.
Upvotes: 1
Views: 794
Reputation: 905
Use this code:
<a href='<%# String.Format(@"Details.aspx?commissionId=" + CommissionId) %>' runat="server" id="cancelLink" class="button" onclick="this.blur();"><span>Back</span></a>
And then add to codebehind:
protected void Page_Load(object sender, EventArgs e)
{
DataBind();
}
Hope it will help you. Good luck!!
Best regards, Dima.
Upvotes: 1