0

I have the following code which works for a postbackurl on a button. What I need to do is do something similar, but with an:

<a href></a>

in asp.net. How can I do that? Thanks for your help!

<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 CODE:

<asp:Button ID="LinkButtonDetails" runat="server" Text="DETAILS" PostBackUrl='<%# GenerateLinkDetails(Eval("CompanyID"), Eval("ProjectName"), Eval("ProjectID")) %>' />
1
  • 1
    what is wrong with the href you have posted in your question? Commented Feb 21, 2011 at 22:20

1 Answer 1

1

Use LinkButton instead. It's an ASP.Net server control and a hyperlink.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.