The problem here is that your code is just creating a literal string
representing the code you want to execute, not "Code that gets executed".
Better to use a method in your codebehind:
protected string FigureItOut( object regId, object sessId)
{
// do your logic here and return the correct string representing the href
value
}
You can refer to this with:
<%# FigureItOut(Eval("RegistrationId"), Session["id"]) %>
Peter
--
Site:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
Short urls & more:
http://ittyurl.net
"Eugene Anthony" wrote:
I am using the following statement in my repeater control.
<%# "if(" + int.Parse(Eval("RegistrationID").ToString()) + "!=" +
int.Parse(Session["id"].ToString()) + "{<a
href=SubscriptionCart.aspx?GroupID=" + Eval("RegistrationID") +
">Subscribe</a>}" %>
The problem is it appears as:
if(1!=1{Subscribe}
How do I solve the problem?
Eugene Anthony
*** Sent via Developersdex http://www.developersdex.com ***